X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=board%2Ffreescale%2Fp1_twr%2Fp1_twr.c;h=fe99ebf4b202e767f21f4d5d4bda5d214046ff11;hb=83d290c56fab2d38cd1ab4c4cc7099559c1d5046;hp=ea8db6fc07d97cce926b45eaf3037e0e8b8858bf;hpb=e62d5fb0da76ef168e90cae9bbbda80349aaf137;p=platform%2Fkernel%2Fu-boot.git diff --git a/board/freescale/p1_twr/p1_twr.c b/board/freescale/p1_twr/p1_twr.c index ea8db6f..fe99ebf 100644 --- a/board/freescale/p1_twr/p1_twr.c +++ b/board/freescale/p1_twr/p1_twr.c @@ -1,7 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2013 Freescale Semiconductor, Inc. - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -14,13 +13,13 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include @@ -155,7 +154,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 region to caching-inhibited @@ -166,8 +165,14 @@ int board_early_init_r(void) flush_dcache(); invalidate_icache(); - /* invalidate existing TLB entry for flash */ - 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 */ + disable_tlb(flash_esel); + } set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS, /* tlb, epn, rpn */ MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, /* perms, wimge */ @@ -255,15 +260,15 @@ static void fdt_board_fixup_qe_pins(void *blob) #endif #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd) { phys_addr_t base; phys_size_t size; ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); @@ -276,6 +281,8 @@ void ft_board_setup(void *blob, bd_t *bd) #if defined(CONFIG_TWR_P1025) fdt_board_fixup_qe_pins(blob); #endif - fdt_fixup_dr_usb(blob, bd); + fsl_fdt_fixup_dr_usb(blob, bd); + + return 0; } #endif