Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2007-2008 |
Stelian Pop | 5ee0c7f | 2011-11-01 00:00:39 +0100 | [diff] [blame] | 4 | * Stelian Pop <stelian@popies.net> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 5 | * Lead Tech Design <www.leadtechdesign.com> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Wenyou.Yang@microchip.com | b59fe68 | 2017-07-21 13:28:40 +0800 | [diff] [blame] | 9 | #include <debug_uart.h> |
Simon Glass | 8e16b1e | 2019-12-28 10:45:05 -0700 | [diff] [blame] | 10 | #include <init.h> |
Simon Glass | f5c208d | 2019-11-14 12:57:20 -0700 | [diff] [blame] | 11 | #include <vsprintf.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 12 | #include <asm/global_data.h> |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 13 | #include <asm/io.h> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 14 | #include <asm/arch/at91sam9261.h> |
| 15 | #include <asm/arch/at91sam9261_matrix.h> |
| 16 | #include <asm/arch/at91sam9_smc.h> |
Jean-Christophe PLAGNIOL-VILLARD | 6b0b3db | 2009-03-21 21:07:59 +0100 | [diff] [blame] | 17 | #include <asm/arch/at91_common.h> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 18 | #include <asm/arch/at91_rstc.h> |
Jean-Christophe PLAGNIOL-VILLARD | 23164f1 | 2009-04-16 21:30:44 +0200 | [diff] [blame] | 19 | #include <asm/arch/clk.h> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 20 | #include <asm/arch/gpio.h> |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 21 | #include <lcd.h> |
| 22 | #include <atmel_lcdc.h> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 23 | #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_DRIVER_DM9000) |
| 24 | #include <net.h> |
Remy Bohmer | 7eefd92 | 2009-05-02 21:49:18 +0200 | [diff] [blame] | 25 | #include <netdev.h> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 26 | #endif |
Simon Glass | 0ffb9d6 | 2017-05-31 19:47:48 -0600 | [diff] [blame] | 27 | #include <asm/mach-types.h> |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 28 | |
| 29 | DECLARE_GLOBAL_DATA_PTR; |
| 30 | |
| 31 | /* ------------------------------------------------------------------------- */ |
| 32 | /* |
| 33 | * Miscelaneous platform dependent initialisations |
| 34 | */ |
| 35 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 36 | #ifdef CONFIG_CMD_NAND |
| 37 | static void at91sam9261ek_nand_hw_init(void) |
| 38 | { |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 39 | struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC; |
| 40 | struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 41 | unsigned long csa; |
| 42 | |
| 43 | /* Enable CS3 */ |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 44 | csa = readl(&matrix->ebicsa); |
| 45 | csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA; |
| 46 | |
| 47 | writel(csa, &matrix->ebicsa); |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 48 | |
| 49 | /* Configure SMC CS3 for NAND/SmartMedia */ |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 50 | #ifdef CONFIG_AT91SAM9G10EK |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 51 | writel(AT91_SMC_SETUP_NWE(2) | AT91_SMC_SETUP_NCS_WR(0) | |
| 52 | AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0), |
| 53 | &smc->cs[3].setup); |
| 54 | writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(7) | |
| 55 | AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(7), |
| 56 | &smc->cs[3].pulse); |
| 57 | writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(7), |
| 58 | &smc->cs[3].cycle); |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 59 | #else |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 60 | writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) | |
| 61 | AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0), |
| 62 | &smc->cs[3].setup); |
| 63 | writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) | |
| 64 | AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3), |
| 65 | &smc->cs[3].pulse); |
| 66 | writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5), |
| 67 | &smc->cs[3].cycle); |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 68 | #endif |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 69 | writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | |
| 70 | AT91_SMC_MODE_EXNW_DISABLE | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 71 | #ifdef CONFIG_SYS_NAND_DBW_16 |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 72 | AT91_SMC_MODE_DBW_16 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 73 | #else /* CONFIG_SYS_NAND_DBW_8 */ |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 74 | AT91_SMC_MODE_DBW_8 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 75 | #endif |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 76 | AT91_SMC_MODE_TDF_CYCLE(2), |
| 77 | &smc->cs[3].mode); |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 78 | |
Wenyou Yang | 78f8976 | 2016-02-03 10:16:50 +0800 | [diff] [blame] | 79 | at91_periph_clk_enable(ATMEL_ID_PIOC); |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 80 | |
| 81 | /* Configure RDY/BSY */ |
Jean-Christophe PLAGNIOL-VILLARD | c9539ba | 2009-03-22 10:22:34 +0100 | [diff] [blame] | 82 | at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1); |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 83 | |
| 84 | /* Enable NandFlash */ |
Jean-Christophe PLAGNIOL-VILLARD | c9539ba | 2009-03-22 10:22:34 +0100 | [diff] [blame] | 85 | at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1); |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 86 | |
| 87 | at91_set_A_periph(AT91_PIN_PC0, 0); /* NANDOE */ |
| 88 | at91_set_A_periph(AT91_PIN_PC1, 0); /* NANDWE */ |
| 89 | } |
| 90 | #endif |
| 91 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 92 | #ifdef CONFIG_DRIVER_DM9000 |
| 93 | static void at91sam9261ek_dm9000_hw_init(void) |
| 94 | { |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 95 | struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC; |
| 96 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 97 | /* Configure SMC CS2 for DM9000 */ |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 98 | #ifdef CONFIG_AT91SAM9G10EK |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 99 | writel(AT91_SMC_SETUP_NWE(3) | AT91_SMC_SETUP_NCS_WR(0) | |
| 100 | AT91_SMC_SETUP_NRD(3) | AT91_SMC_SETUP_NCS_RD(0), |
| 101 | &smc->cs[2].setup); |
| 102 | writel(AT91_SMC_PULSE_NWE(6) | AT91_SMC_PULSE_NCS_WR(8) | |
| 103 | AT91_SMC_PULSE_NRD(6) | AT91_SMC_PULSE_NCS_RD(8), |
| 104 | &smc->cs[2].pulse); |
| 105 | writel(AT91_SMC_CYCLE_NWE(20) | AT91_SMC_CYCLE_NRD(20), |
| 106 | &smc->cs[2].cycle); |
| 107 | writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | |
| 108 | AT91_SMC_MODE_EXNW_DISABLE | |
| 109 | AT91_SMC_MODE_BAT | AT91_SMC_MODE_DBW_16 | |
| 110 | AT91_SMC_MODE_TDF_CYCLE(1), |
| 111 | &smc->cs[2].mode); |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 112 | #else |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 113 | writel(AT91_SMC_SETUP_NWE(3) | AT91_SMC_SETUP_NCS_WR(0) | |
| 114 | AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0), |
| 115 | &smc->cs[2].setup); |
| 116 | writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(8) | |
| 117 | AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(8), |
| 118 | &smc->cs[2].pulse); |
| 119 | writel(AT91_SMC_CYCLE_NWE(16) | AT91_SMC_CYCLE_NRD(16), |
| 120 | &smc->cs[2].cycle); |
| 121 | writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | |
| 122 | AT91_SMC_MODE_EXNW_DISABLE | |
| 123 | AT91_SMC_MODE_BAT | AT91_SMC_MODE_DBW_16 | |
| 124 | AT91_SMC_MODE_TDF_CYCLE(1), |
| 125 | &smc->cs[2].mode); |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 126 | #endif |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 127 | |
| 128 | /* Configure Reset signal as output */ |
| 129 | at91_set_gpio_output(AT91_PIN_PC10, 0); |
| 130 | |
| 131 | /* Configure Interrupt pin as input, no pull-up */ |
| 132 | at91_set_gpio_input(AT91_PIN_PC11, 0); |
| 133 | } |
| 134 | #endif |
| 135 | |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 136 | #ifdef CONFIG_LCD |
| 137 | vidinfo_t panel_info = { |
Jeroen Hofstee | e887b72 | 2014-06-10 00:16:23 +0200 | [diff] [blame] | 138 | .vl_col = 240, |
| 139 | .vl_row = 320, |
| 140 | .vl_clk = 4965000, |
| 141 | .vl_sync = ATMEL_LCDC_INVLINE_INVERTED | |
| 142 | ATMEL_LCDC_INVFRAME_INVERTED, |
| 143 | .vl_bpix = 3, |
| 144 | .vl_tft = 1, |
| 145 | .vl_hsync_len = 5, |
| 146 | .vl_left_margin = 1, |
| 147 | .vl_right_margin = 33, |
| 148 | .vl_vsync_len = 1, |
| 149 | .vl_upper_margin = 1, |
| 150 | .vl_lower_margin = 0, |
| 151 | .mmio = ATMEL_BASE_LCDC, |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 152 | }; |
| 153 | |
| 154 | void lcd_enable(void) |
| 155 | { |
| 156 | at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */ |
| 157 | } |
| 158 | |
| 159 | void lcd_disable(void) |
| 160 | { |
| 161 | at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */ |
| 162 | } |
| 163 | |
| 164 | static void at91sam9261ek_lcd_hw_init(void) |
| 165 | { |
| 166 | at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */ |
| 167 | at91_set_A_periph(AT91_PIN_PB2, 0); /* LCDDOTCK */ |
| 168 | at91_set_A_periph(AT91_PIN_PB3, 0); /* LCDDEN */ |
| 169 | at91_set_A_periph(AT91_PIN_PB4, 0); /* LCDCC */ |
| 170 | at91_set_A_periph(AT91_PIN_PB7, 0); /* LCDD2 */ |
| 171 | at91_set_A_periph(AT91_PIN_PB8, 0); /* LCDD3 */ |
| 172 | at91_set_A_periph(AT91_PIN_PB9, 0); /* LCDD4 */ |
| 173 | at91_set_A_periph(AT91_PIN_PB10, 0); /* LCDD5 */ |
| 174 | at91_set_A_periph(AT91_PIN_PB11, 0); /* LCDD6 */ |
| 175 | at91_set_A_periph(AT91_PIN_PB12, 0); /* LCDD7 */ |
| 176 | at91_set_A_periph(AT91_PIN_PB15, 0); /* LCDD10 */ |
| 177 | at91_set_A_periph(AT91_PIN_PB16, 0); /* LCDD11 */ |
| 178 | at91_set_A_periph(AT91_PIN_PB17, 0); /* LCDD12 */ |
| 179 | at91_set_A_periph(AT91_PIN_PB18, 0); /* LCDD13 */ |
| 180 | at91_set_A_periph(AT91_PIN_PB19, 0); /* LCDD14 */ |
| 181 | at91_set_A_periph(AT91_PIN_PB20, 0); /* LCDD15 */ |
| 182 | at91_set_B_periph(AT91_PIN_PB23, 0); /* LCDD18 */ |
| 183 | at91_set_B_periph(AT91_PIN_PB24, 0); /* LCDD19 */ |
| 184 | at91_set_B_periph(AT91_PIN_PB25, 0); /* LCDD20 */ |
| 185 | at91_set_B_periph(AT91_PIN_PB26, 0); /* LCDD21 */ |
| 186 | at91_set_B_periph(AT91_PIN_PB27, 0); /* LCDD22 */ |
| 187 | at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */ |
| 188 | |
Wenyou Yang | 78f8976 | 2016-02-03 10:16:50 +0800 | [diff] [blame] | 189 | at91_system_clk_enable(AT91_PMC_HCK1); |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 190 | |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 191 | /* For 9G10EK, let U-Boot allocate the framebuffer in SDRAM */ |
| 192 | #ifdef CONFIG_AT91SAM9261EK |
| 193 | gd->fb_base = ATMEL_BASE_SRAM; |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 194 | #endif |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 195 | } |
Haavard Skinnemoen | ddbcf95 | 2008-09-01 16:21:22 +0200 | [diff] [blame] | 196 | |
| 197 | #ifdef CONFIG_LCD_INFO |
| 198 | #include <nand.h> |
| 199 | #include <version.h> |
| 200 | |
| 201 | void lcd_show_board_info(void) |
| 202 | { |
| 203 | ulong dram_size, nand_size; |
| 204 | int i; |
| 205 | char temp[32]; |
| 206 | |
| 207 | lcd_printf ("%s\n", U_BOOT_VERSION); |
| 208 | lcd_printf ("(C) 2008 ATMEL Corp\n"); |
| 209 | lcd_printf ("at91support@atmel.com\n"); |
| 210 | lcd_printf ("%s CPU at %s MHz\n", |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 211 | ATMEL_CPU_NAME, |
Jean-Christophe PLAGNIOL-VILLARD | 23164f1 | 2009-04-16 21:30:44 +0200 | [diff] [blame] | 212 | strmhz(temp, get_cpu_clk_rate())); |
Haavard Skinnemoen | ddbcf95 | 2008-09-01 16:21:22 +0200 | [diff] [blame] | 213 | |
| 214 | dram_size = 0; |
| 215 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) |
| 216 | dram_size += gd->bd->bi_dram[i].size; |
| 217 | nand_size = 0; |
| 218 | for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) |
Grygorii Strashko | 1e096a2 | 2017-06-26 19:13:03 -0500 | [diff] [blame] | 219 | nand_size += get_nand_dev_by_index(i)->size; |
Haavard Skinnemoen | ddbcf95 | 2008-09-01 16:21:22 +0200 | [diff] [blame] | 220 | lcd_printf (" %ld MB SDRAM, %ld MB NAND\n", |
| 221 | dram_size >> 20, |
| 222 | nand_size >> 20 ); |
| 223 | } |
| 224 | #endif /* CONFIG_LCD_INFO */ |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 225 | #endif |
| 226 | |
Wenyou.Yang@microchip.com | b59fe68 | 2017-07-21 13:28:40 +0800 | [diff] [blame] | 227 | #ifdef CONFIG_DEBUG_UART_BOARD_INIT |
| 228 | void board_debug_uart_init(void) |
| 229 | { |
| 230 | at91_seriald_hw_init(); |
| 231 | } |
| 232 | #endif |
| 233 | |
| 234 | #ifdef CONFIG_BOARD_EARLY_INIT_F |
| 235 | int board_early_init_f(void) |
| 236 | { |
| 237 | #ifdef CONFIG_DEBUG_UART |
| 238 | debug_uart_init(); |
| 239 | #endif |
| 240 | return 0; |
| 241 | } |
| 242 | #endif |
| 243 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 244 | int board_init(void) |
| 245 | { |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 246 | #ifdef CONFIG_AT91SAM9G10EK |
| 247 | /* arch number of AT91SAM9G10EK-Board */ |
| 248 | gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G10EK; |
| 249 | #else |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 250 | /* arch number of AT91SAM9261EK-Board */ |
| 251 | gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9261EK; |
Sedji Gaouaou | 97a031b | 2009-06-25 17:04:15 +0200 | [diff] [blame] | 252 | #endif |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 253 | /* adress of boot parameters */ |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 254 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 255 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 256 | #ifdef CONFIG_CMD_NAND |
| 257 | at91sam9261ek_nand_hw_init(); |
| 258 | #endif |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 259 | #ifdef CONFIG_DRIVER_DM9000 |
| 260 | at91sam9261ek_dm9000_hw_init(); |
| 261 | #endif |
Stelian Pop | 905ed22 | 2008-05-08 14:52:30 +0200 | [diff] [blame] | 262 | #ifdef CONFIG_LCD |
| 263 | at91sam9261ek_lcd_hw_init(); |
| 264 | #endif |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 265 | return 0; |
| 266 | } |
| 267 | |
Remy Bohmer | 7eefd92 | 2009-05-02 21:49:18 +0200 | [diff] [blame] | 268 | #ifdef CONFIG_DRIVER_DM9000 |
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 269 | int board_eth_init(struct bd_info *bis) |
Wolfgang Denk | e5032c8 | 2009-12-07 21:06:40 +0100 | [diff] [blame] | 270 | { |
Remy Bohmer | 7eefd92 | 2009-05-02 21:49:18 +0200 | [diff] [blame] | 271 | return dm9000_initialize(bis); |
Wolfgang Denk | e5032c8 | 2009-12-07 21:06:40 +0100 | [diff] [blame] | 272 | } |
| 273 | #endif |
| 274 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 275 | int dram_init(void) |
| 276 | { |
Xu, Hong | 0a61494 | 2011-07-31 22:49:00 +0000 | [diff] [blame] | 277 | gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, |
| 278 | CONFIG_SYS_SDRAM_SIZE); |
| 279 | |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 280 | return 0; |
| 281 | } |
| 282 | |
| 283 | #ifdef CONFIG_RESET_PHY_R |
| 284 | void reset_phy(void) |
| 285 | { |
| 286 | #ifdef CONFIG_DRIVER_DM9000 |
| 287 | /* |
| 288 | * Initialize ethernet HW addr prior to starting Linux, |
| 289 | * needed for nfsroot |
| 290 | */ |
Joe Hershberger | 3dbe17e | 2015-03-22 17:09:06 -0500 | [diff] [blame] | 291 | eth_init(); |
Stelian Pop | 61e69d7 | 2008-05-08 20:52:22 +0200 | [diff] [blame] | 292 | #endif |
| 293 | } |
| 294 | #endif |