Commit a321148b5b38150b011a1df4ad198329a49e98a3
1 parent
f7b548adb5
Exists in
master
and in
54 other branches
ppc4xx: Update lwmon5 board support
This patch includes the following changes for the lwmon5 board support: - Enable cache in SDRAM - Use common EHCI driver instead of the PPC4xx specific OHCI driver This can be done since only high-speed devices are connected. - Remove cached TLB entry again after ECC setup - Use correct define for cache enabling (CONFIG_4xx_DCACHE instead of CONFIG_SYS_ENABLE_SDRAM_CACHE) - Enable FIT image support Signed-off-by: Stefan Roese <sr@denx.de>
Showing 2 changed files with 32 additions and 12 deletions Side-by-side Diff
board/lwmon5/sdram.c
... | ... | @@ -45,10 +45,10 @@ |
45 | 45 | * memory. |
46 | 46 | * |
47 | 47 | * If at some time this restriction doesn't apply anymore, just define |
48 | - * CONFIG_SYS_ENABLE_SDRAM_CACHE in the board config file and this code should setup | |
48 | + * CONFIG_4xx_DCACHE in the board config file and this code should setup | |
49 | 49 | * everything correctly. |
50 | 50 | */ |
51 | -#ifdef CONFIG_SYS_ENABLE_SDRAM_CACHE | |
51 | +#ifdef CONFIG_4xx_DCACHE | |
52 | 52 | #define MY_TLB_WORD2_I_ENABLE 0 /* enable caching on SDRAM */ |
53 | 53 | #else |
54 | 54 | #define MY_TLB_WORD2_I_ENABLE TLB_WORD2_I_ENABLE /* disable caching on SDRAM */ |
55 | 55 | |
56 | 56 | |
57 | 57 | |
... | ... | @@ -220,18 +220,32 @@ |
220 | 220 | program_tlb(0, CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MBYTES_SDRAM << 20, |
221 | 221 | MY_TLB_WORD2_I_ENABLE); |
222 | 222 | |
223 | +#if defined(CONFIG_DDR_ECC) | |
224 | +#if defined(CONFIG_4xx_DCACHE) | |
223 | 225 | /* |
226 | + * If ECC is enabled, initialize the parity bits. | |
227 | + */ | |
228 | + program_ecc(0, CONFIG_SYS_MBYTES_SDRAM << 20, 0); | |
229 | +#else /* CONFIG_4xx_DCACHE */ | |
230 | + /* | |
224 | 231 | * Setup 2nd TLB with same physical address but different virtual address |
225 | 232 | * with cache enabled. This is done for fast ECC generation. |
226 | 233 | */ |
227 | 234 | program_tlb(0, CONFIG_SYS_DDR_CACHED_ADDR, CONFIG_SYS_MBYTES_SDRAM << 20, 0); |
228 | 235 | |
229 | -#ifdef CONFIG_DDR_ECC | |
230 | 236 | /* |
231 | 237 | * If ECC is enabled, initialize the parity bits. |
232 | 238 | */ |
233 | 239 | program_ecc(CONFIG_SYS_DDR_CACHED_ADDR, CONFIG_SYS_MBYTES_SDRAM << 20, 0); |
234 | -#endif | |
240 | + | |
241 | + /* | |
242 | + * Now after initialization (auto-calibration and ECC generation) | |
243 | + * remove the TLB entries with caches enabled and program again with | |
244 | + * desired cache functionality | |
245 | + */ | |
246 | + remove_tlb(CONFIG_SYS_DDR_CACHED_ADDR, CONFIG_SYS_MBYTES_SDRAM << 20); | |
247 | +#endif /* CONFIG_4xx_DCACHE */ | |
248 | +#endif /* CONFIG_DDR_ECC */ | |
235 | 249 | |
236 | 250 | /* |
237 | 251 | * Clear possible errors resulting from data-eye-search. |
include/configs/lwmon5.h
... | ... | @@ -43,6 +43,8 @@ |
43 | 43 | |
44 | 44 | #define CONFIG_SYS_CLK_FREQ 33300000 /* external freq to pll */ |
45 | 45 | |
46 | +#define CONFIG_4xx_DCACHE /* enable cache in SDRAM */ | |
47 | + | |
46 | 48 | #define CONFIG_BOARD_EARLY_INIT_F /* Call board_early_init_f */ |
47 | 49 | #define CONFIG_BOARD_EARLY_INIT_R /* Call board_early_init_r */ |
48 | 50 | #define CONFIG_BOARD_POSTCLK_INIT /* Call board_postclk_init */ |
... | ... | @@ -321,6 +323,8 @@ |
321 | 323 | /* Update size in "reg" property of NOR FLASH device tree nodes */ |
322 | 324 | #define CONFIG_FDT_FIXUP_NOR_FLASH_SIZE |
323 | 325 | |
326 | +#define CONFIG_FIT /* enable FIT image support */ | |
327 | + | |
324 | 328 | #define CONFIG_POST_KEY_MAGIC "3C+3E" /* press F3 + F5 keys to force POST */ |
325 | 329 | |
326 | 330 | #define CONFIG_PREBOOT "setenv bootdelay 15" |
327 | 331 | |
... | ... | @@ -393,15 +397,17 @@ |
393 | 397 | #define CONFIG_VIDEO_SW_CURSOR |
394 | 398 | #define CONFIG_SPLASH_SCREEN |
395 | 399 | |
396 | -/* USB */ | |
397 | -#ifdef CONFIG_440EPX | |
398 | -#define CONFIG_USB_OHCI | |
400 | +/* | |
401 | + * USB/EHCI | |
402 | + */ | |
403 | +#define CONFIG_USB_EHCI /* Enable EHCI USB support */ | |
404 | +#define CONFIG_USB_EHCI_PPC4XX /* on PPC4xx platform */ | |
405 | +#define CONFIG_SYS_PPC4XX_USB_ADDR 0xe0000300 | |
406 | +#define CONFIG_EHCI_DCACHE /* with dcache handling support */ | |
407 | +#define CONFIG_EHCI_MMIO_BIG_ENDIAN | |
408 | +#define CONFIG_EHCI_DESC_BIG_ENDIAN | |
409 | +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* re-init HCD after CMD_RESET */ | |
399 | 410 | #define CONFIG_USB_STORAGE |
400 | - | |
401 | -/* Comment this out to enable USB 1.1 device */ | |
402 | -#define USB_2_0_DEVICE | |
403 | - | |
404 | -#endif /* CONFIG_440EPX */ | |
405 | 411 | |
406 | 412 | /* Partitions */ |
407 | 413 | #define CONFIG_MAC_PARTITION |