mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-16 16:23:14 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2014 Andreas Bießmann <andreas@biessmann.org>
|
|
*/
|
|
|
|
/*
|
|
* This is a host tool for generating an appropriate string out of board
|
|
* configuration. The string is required for correct generation of PMECC
|
|
* header which in turn is required for NAND flash booting of Atmel AT91 style
|
|
* hardware.
|
|
*
|
|
* See doc/README.atmel_pmecc for more information.
|
|
*/
|
|
|
|
#include <config.h>
|
|
#include <stdlib.h>
|
|
|
|
static int pmecc_get_ecc_bytes(int cap, int sector_size)
|
|
{
|
|
int m = 12 + sector_size / 512;
|
|
return (m * cap + 7) / 8;
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
unsigned int use_pmecc = 0;
|
|
unsigned int sector_per_page;
|
|
unsigned int sector_size = CONFIG_PMECC_SECTOR_SIZE;
|
|
unsigned int oob_size = CONFIG_SYS_NAND_OOBSIZE;
|
|
unsigned int ecc_bits = CONFIG_PMECC_CAP;
|
|
unsigned int ecc_offset;
|
|
|
|
#ifdef CONFIG_ATMEL_NAND_HW_PMECC
|
|
use_pmecc = 1;
|
|
#endif
|
|
|
|
sector_per_page = CONFIG_SYS_NAND_PAGE_SIZE / CONFIG_PMECC_SECTOR_SIZE;
|
|
ecc_offset = oob_size -
|
|
pmecc_get_ecc_bytes(ecc_bits, sector_size) * sector_per_page;
|
|
|
|
printf("usePmecc=%d,", use_pmecc);
|
|
printf("sectorPerPage=%d,", sector_per_page);
|
|
printf("sectorSize=%d,", sector_size);
|
|
printf("spareSize=%d,", oob_size);
|
|
printf("eccBits=%d,", ecc_bits);
|
|
printf("eccOffset=%d", ecc_offset);
|
|
printf("\n");
|
|
|
|
exit(EXIT_SUCCESS);
|
|
}
|