2 * Copyright 2010 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * Version 2 as published by the Free Software Foundation.
10 #include <asm/fsl_lbc.h>
12 void print_lbc_regs(void)
16 printf("\nLocal Bus Controller Registers\n");
17 for (i = 0; i < 8; i++) {
18 printf("BR%d\t0x%08X\tOR%d\t0x%08X\n",
19 i, get_lbc_br(i), i, get_lbc_or(i));
23 void init_early_memctl_regs(void)
28 /* if cs1 is already set via debugger, leave cs0/cs1 alone */
29 if (get_lbc_br(1) & BR_V)
34 * Map banks 0 (and maybe 1) to the FLASH banks 0 (and 1) at
35 * preliminary addresses - these have to be modified later
36 * when FLASH size has been determined
38 #if defined(CONFIG_SYS_OR0_REMAP)
39 set_lbc_or(0, CONFIG_SYS_OR0_REMAP);
41 #if defined(CONFIG_SYS_OR1_REMAP)
42 set_lbc_or(1, CONFIG_SYS_OR1_REMAP);
44 /* now restrict to preliminary range */
46 set_lbc_br(0, CONFIG_SYS_BR0_PRELIM);
47 set_lbc_or(0, CONFIG_SYS_OR0_PRELIM);
49 #if defined(CONFIG_SYS_BR1_PRELIM) && defined(CONFIG_SYS_OR1_PRELIM)
50 set_lbc_or(1, CONFIG_SYS_OR1_PRELIM);
51 set_lbc_br(1, CONFIG_SYS_BR1_PRELIM);
55 #if defined(CONFIG_SYS_BR2_PRELIM) && defined(CONFIG_SYS_OR2_PRELIM)
56 set_lbc_or(2, CONFIG_SYS_OR2_PRELIM);
57 set_lbc_br(2, CONFIG_SYS_BR2_PRELIM);
60 #if defined(CONFIG_SYS_BR3_PRELIM) && defined(CONFIG_SYS_OR3_PRELIM)
61 set_lbc_or(3, CONFIG_SYS_OR3_PRELIM);
62 set_lbc_br(3, CONFIG_SYS_BR3_PRELIM);
65 #if defined(CONFIG_SYS_BR4_PRELIM) && defined(CONFIG_SYS_OR4_PRELIM)
66 set_lbc_or(4, CONFIG_SYS_OR4_PRELIM);
67 set_lbc_br(4, CONFIG_SYS_BR4_PRELIM);
70 #if defined(CONFIG_SYS_BR5_PRELIM) && defined(CONFIG_SYS_OR5_PRELIM)
71 set_lbc_or(5, CONFIG_SYS_OR5_PRELIM);
72 set_lbc_br(5, CONFIG_SYS_BR5_PRELIM);
75 #if defined(CONFIG_SYS_BR6_PRELIM) && defined(CONFIG_SYS_OR6_PRELIM)
76 set_lbc_or(6, CONFIG_SYS_OR6_PRELIM);
77 set_lbc_br(6, CONFIG_SYS_BR6_PRELIM);
80 #if defined(CONFIG_SYS_BR7_PRELIM) && defined(CONFIG_SYS_OR7_PRELIM)
81 set_lbc_or(7, CONFIG_SYS_OR7_PRELIM);
82 set_lbc_br(7, CONFIG_SYS_BR7_PRELIM);