diff options
Diffstat (limited to 'arch/powerpc/boot/ebony.c')
-rw-r--r-- | arch/powerpc/boot/ebony.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/arch/powerpc/boot/ebony.c b/arch/powerpc/boot/ebony.c index 75daedafd0a4..86c0f5df0a86 100644 --- a/arch/powerpc/boot/ebony.c +++ b/arch/powerpc/boot/ebony.c | |||
@@ -24,12 +24,11 @@ | |||
24 | #include "page.h" | 24 | #include "page.h" |
25 | #include "ops.h" | 25 | #include "ops.h" |
26 | #include "reg.h" | 26 | #include "reg.h" |
27 | #include "io.h" | ||
27 | #include "dcr.h" | 28 | #include "dcr.h" |
29 | #include "4xx.h" | ||
28 | #include "44x.h" | 30 | #include "44x.h" |
29 | 31 | ||
30 | extern char _dtb_start[]; | ||
31 | extern char _dtb_end[]; | ||
32 | |||
33 | static u8 *ebony_mac0, *ebony_mac1; | 32 | static u8 *ebony_mac0, *ebony_mac1; |
34 | 33 | ||
35 | /* Calculate 440GP clocks */ | 34 | /* Calculate 440GP clocks */ |
@@ -92,15 +91,53 @@ void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk) | |||
92 | dt_fixup_clock("/plb/opb/serial@40000300", uart1); | 91 | dt_fixup_clock("/plb/opb/serial@40000300", uart1); |
93 | } | 92 | } |
94 | 93 | ||
94 | #define EBONY_FPGA_PATH "/plb/opb/ebc/fpga" | ||
95 | #define EBONY_FPGA_FLASH_SEL 0x01 | ||
96 | #define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash" | ||
97 | |||
98 | static void ebony_flashsel_fixup(void) | ||
99 | { | ||
100 | void *devp; | ||
101 | u32 reg[3] = {0x0, 0x0, 0x80000}; | ||
102 | u8 *fpga; | ||
103 | u8 fpga_reg0 = 0x0; | ||
104 | |||
105 | devp = finddevice(EBONY_FPGA_PATH); | ||
106 | if (!devp) | ||
107 | fatal("Couldn't locate FPGA node %s\n\r", EBONY_FPGA_PATH); | ||
108 | |||
109 | if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga)) | ||
110 | fatal("%s has missing or invalid virtual-reg property\n\r", | ||
111 | EBONY_FPGA_PATH); | ||
112 | |||
113 | fpga_reg0 = in_8(fpga); | ||
114 | |||
115 | devp = finddevice(EBONY_SMALL_FLASH_PATH); | ||
116 | if (!devp) | ||
117 | fatal("Couldn't locate small flash node %s\n\r", | ||
118 | EBONY_SMALL_FLASH_PATH); | ||
119 | |||
120 | if (getprop(devp, "reg", reg, sizeof(reg)) != sizeof(reg)) | ||
121 | fatal("%s has reg property of unexpected size\n\r", | ||
122 | EBONY_SMALL_FLASH_PATH); | ||
123 | |||
124 | /* Invert address bit 14 (IBM-endian) if FLASH_SEL fpga bit is set */ | ||
125 | if (fpga_reg0 & EBONY_FPGA_FLASH_SEL) | ||
126 | reg[1] ^= 0x80000; | ||
127 | |||
128 | setprop(devp, "reg", reg, sizeof(reg)); | ||
129 | } | ||
130 | |||
95 | static void ebony_fixups(void) | 131 | static void ebony_fixups(void) |
96 | { | 132 | { |
97 | // FIXME: sysclk should be derived by reading the FPGA registers | 133 | // FIXME: sysclk should be derived by reading the FPGA registers |
98 | unsigned long sysclk = 33000000; | 134 | unsigned long sysclk = 33000000; |
99 | 135 | ||
100 | ibm440gp_fixup_clocks(sysclk, 6 * 1843200); | 136 | ibm440gp_fixup_clocks(sysclk, 6 * 1843200); |
101 | ibm44x_fixup_memsize(); | 137 | ibm4xx_fixup_memsize(); |
102 | dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); | 138 | dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); |
103 | ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); | 139 | ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); |
140 | ebony_flashsel_fixup(); | ||
104 | } | 141 | } |
105 | 142 | ||
106 | void ebony_init(void *mac0, void *mac1) | 143 | void ebony_init(void *mac0, void *mac1) |