From 9d0456822c4fec302608d4161ae9d9cfe81100b1 Mon Sep 17 00:00:00 2001 From: York Sun Date: Tue, 24 Jun 2014 21:16:20 -0700 Subject: powerpc/mpc85xx: Check return value of find_tlb_idx find_tlb_idx() is called in board_early_init_r() on multiple boards. The return value is not checked before being used to disable a TLB. In normal case the return value wouldn't be -1. In case of a mis- configuration during porting to a new board, checking the return value may be helpful to reveal some user errors. Signed-off-by: York Sun --- board/freescale/p2020ds/p2020ds.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'board/freescale/p2020ds') diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index a0cf927..b72fcff 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -159,7 +159,7 @@ void pci_init_board(void) int board_early_init_r(void) { const unsigned int flashbase = CONFIG_SYS_FLASH_BASE; - const u8 flash_esel = find_tlb_idx((void *)flashbase, 1); + int flash_esel = find_tlb_idx((void *)flashbase, 1); /* * Remap Boot flash + PROMJET region to caching-inhibited @@ -170,8 +170,14 @@ int board_early_init_r(void) flush_dcache(); invalidate_icache(); - /* invalidate existing TLB entry for flash + promjet */ - disable_tlb(flash_esel); + if (flash_esel == -1) { + /* very unlikely unless something is messed up */ + puts("Error: Could not find TLB for FLASH BASE\n"); + flash_esel = 2; /* give our best effort to continue */ + } else { + /* invalidate existing TLB entry for flash + promjet */ + disable_tlb(flash_esel); + } set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS, MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, -- cgit v1.1 From dd84058d24ff54d6b32818ffe44aeb4bba2cfae6 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 30 Jul 2014 14:08:14 +0900 Subject: kconfig: add board Kconfig and defconfig files This commit adds: - arch/${ARCH}/Kconfig provide a menu to select target boards - board/${VENDOR}/${BOARD}/Kconfig or board/${BOARD}/Kconfig set CONFIG macros to the appropriate values for each board - configs/${TARGET_BOARD}_defconfig default setting of each board (This commit was automatically generated by a conversion script based on boards.cfg) In Linux Kernel, defconfig files are located under arch/${ARCH}/configs/ directory. It works in Linux Kernel since ARCH is always given from the command line for cross compile. But in U-Boot, ARCH is not given from the command line. Which means we cannot know ARCH until the board configuration is done. That is why all the "*_defconfig" files should be gathered into a single directory ./configs/. Signed-off-by: Masahiro Yamada Acked-by: Simon Glass --- board/freescale/p2020ds/Kconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 board/freescale/p2020ds/Kconfig (limited to 'board/freescale/p2020ds') diff --git a/board/freescale/p2020ds/Kconfig b/board/freescale/p2020ds/Kconfig new file mode 100644 index 0000000..29031d0 --- /dev/null +++ b/board/freescale/p2020ds/Kconfig @@ -0,0 +1,15 @@ +if TARGET_P2020DS + +config SYS_BOARD + string + default "p2020ds" + +config SYS_VENDOR + string + default "freescale" + +config SYS_CONFIG_NAME + string + default "P2020DS" + +endif -- cgit v1.1 From 93d4334f7f5bc2f0fb580606f0701b2252c6d8d6 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 30 Jul 2014 14:08:18 +0900 Subject: Add board MAINTAINERS files We have switched to Kconfig and the boards.cfg file is going to be removed. We have to retrieve the board status and maintainers information from it. The MAINTAINERS format as in Linux Kernel would be nice because we can crib the scripts/get_maintainer.pl script. After some discussion, we chose to put a MAINTAINERS file under each board directory, not the top-level one because we want to collect relevant information for a board into a single place. TODO: Modify get_maintainer.pl to scan multiple MAINTAINERS files. Signed-off-by: Masahiro Yamada Suggested-by: Tom Rini Acked-by: Simon Glass --- board/freescale/p2020ds/MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 board/freescale/p2020ds/MAINTAINERS (limited to 'board/freescale/p2020ds') diff --git a/board/freescale/p2020ds/MAINTAINERS b/board/freescale/p2020ds/MAINTAINERS new file mode 100644 index 0000000..42cb18d --- /dev/null +++ b/board/freescale/p2020ds/MAINTAINERS @@ -0,0 +1,10 @@ +P2020DS BOARD +M: - +S: Maintained +F: board/freescale/p2020ds/ +F: include/configs/P2020DS.h +F: configs/P2020DS_defconfig +F: configs/P2020DS_36BIT_defconfig +F: configs/P2020DS_DDR2_defconfig +F: configs/P2020DS_SDCARD_defconfig +F: configs/P2020DS_SPIFLASH_defconfig -- cgit v1.1