blob: 7633d65e6c988e6f1a00c766500c2db370dbe930 [file] [log] [blame]
Ian Campbell6efe3692014-05-05 11:52:26 +01001/*
2 * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
3 * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
4 *
5 * (C) Copyright 2007-2011
6 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
7 * Tom Cubie <tangliang@allwinnertech.com>
8 *
9 * Some board init for the Allwinner A10-evb board.
10 *
11 * SPDX-License-Identifier: GPL-2.0+
12 */
13
14#include <common.h>
Hans de Goede63deaa82014-10-02 21:13:54 +020015#include <mmc.h>
Hans de Goede1f247362014-06-13 22:55:51 +020016#ifdef CONFIG_AXP152_POWER
17#include <axp152.h>
18#endif
Henrik Nordstromaa382ad2014-06-13 22:55:50 +020019#ifdef CONFIG_AXP209_POWER
20#include <axp209.h>
21#endif
Oliver Schinagld3a558d2013-07-26 12:56:58 +020022#ifdef CONFIG_AXP221_POWER
23#include <axp221.h>
24#endif
Ian Campbell6efe3692014-05-05 11:52:26 +010025#include <asm/arch/clock.h>
Jonathan Liuabc1aae2014-06-14 08:59:09 +020026#include <asm/arch/cpu.h>
Luc Verhaegen4869a8c2014-08-13 07:55:07 +020027#include <asm/arch/display.h>
Ian Campbell6efe3692014-05-05 11:52:26 +010028#include <asm/arch/dram.h>
Ian Campbellb4e9f2f2014-05-05 14:42:31 +010029#include <asm/arch/gpio.h>
30#include <asm/arch/mmc.h>
Hans de Goedef494cad2015-01-11 17:17:00 +010031#include <asm/arch/usbc.h>
Jonathan Liuabc1aae2014-06-14 08:59:09 +020032#include <asm/io.h>
Hans de Goedef494cad2015-01-11 17:17:00 +010033#include <linux/usb/musb.h>
Jonathan Liuabc1aae2014-06-14 08:59:09 +020034#include <net.h>
Ian Campbell6efe3692014-05-05 11:52:26 +010035
Hans de Goedea5b4cfe2015-02-16 17:23:25 +010036#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
37/* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */
38int soft_i2c_gpio_sda;
39int soft_i2c_gpio_scl;
40#endif
41
Ian Campbell6efe3692014-05-05 11:52:26 +010042DECLARE_GLOBAL_DATA_PTR;
43
44/* add board specific code here */
45int board_init(void)
46{
47 int id_pfr1;
48
49 gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
50
51 asm volatile("mrc p15, 0, %0, c0, c1, 1" : "=r"(id_pfr1));
52 debug("id_pfr1: 0x%08x\n", id_pfr1);
53 /* Generic Timer Extension available? */
54 if ((id_pfr1 >> 16) & 0xf) {
55 debug("Setting CNTFRQ\n");
56 /* CNTFRQ == 24 MHz */
57 asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r"(24000000));
58 }
59
60 return 0;
61}
62
63int dram_init(void)
64{
65 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE);
66
67 return 0;
68}
69
Ian Campbellb4e9f2f2014-05-05 14:42:31 +010070#ifdef CONFIG_GENERIC_MMC
71static void mmc_pinmux_setup(int sdc)
72{
73 unsigned int pin;
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +010074 __maybe_unused int pins;
Ian Campbellb4e9f2f2014-05-05 14:42:31 +010075
76 switch (sdc) {
77 case 0:
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +010078 /* SDC0: PF0-PF5 */
Ian Campbellb4e9f2f2014-05-05 14:42:31 +010079 for (pin = SUNXI_GPF(0); pin <= SUNXI_GPF(5); pin++) {
Paul Kocialkowskiae358a42015-03-22 18:12:22 +010080 sunxi_gpio_set_cfgpin(pin, SUNXI_GPF_SDC0);
Ian Campbellb4e9f2f2014-05-05 14:42:31 +010081 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
82 sunxi_gpio_set_drv(pin, 2);
83 }
84 break;
85
86 case 1:
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +010087 pins = sunxi_name_to_gpio_bank(CONFIG_MMC1_PINS);
88
89#if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I)
90 if (pins == SUNXI_GPIO_H) {
91 /* SDC1: PH22-PH-27 */
92 for (pin = SUNXI_GPH(22); pin <= SUNXI_GPH(27); pin++) {
93 sunxi_gpio_set_cfgpin(pin, SUN4I_GPH_SDC1);
94 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
95 sunxi_gpio_set_drv(pin, 2);
96 }
97 } else {
98 /* SDC1: PG0-PG5 */
99 for (pin = SUNXI_GPG(0); pin <= SUNXI_GPG(5); pin++) {
100 sunxi_gpio_set_cfgpin(pin, SUN4I_GPG_SDC1);
101 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
102 sunxi_gpio_set_drv(pin, 2);
103 }
104 }
105#elif defined(CONFIG_MACH_SUN5I)
106 /* SDC1: PG3-PG8 */
Hans de Goede4dccfd42014-10-03 16:44:57 +0200107 for (pin = SUNXI_GPG(3); pin <= SUNXI_GPG(8); pin++) {
Paul Kocialkowskiae358a42015-03-22 18:12:22 +0100108 sunxi_gpio_set_cfgpin(pin, SUN5I_GPG_SDC1);
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100109 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
110 sunxi_gpio_set_drv(pin, 2);
111 }
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +0100112#elif defined(CONFIG_MACH_SUN6I)
113 /* SDC1: PG0-PG5 */
114 for (pin = SUNXI_GPG(0); pin <= SUNXI_GPG(5); pin++) {
115 sunxi_gpio_set_cfgpin(pin, SUN6I_GPG_SDC1);
116 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
117 sunxi_gpio_set_drv(pin, 2);
118 }
119#elif defined(CONFIG_MACH_SUN8I)
120 if (pins == SUNXI_GPIO_D) {
121 /* SDC1: PD2-PD7 */
122 for (pin = SUNXI_GPD(2); pin <= SUNXI_GPD(7); pin++) {
123 sunxi_gpio_set_cfgpin(pin, SUN8I_GPD_SDC1);
124 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
125 sunxi_gpio_set_drv(pin, 2);
126 }
127 } else {
128 /* SDC1: PG0-PG5 */
129 for (pin = SUNXI_GPG(0); pin <= SUNXI_GPG(5); pin++) {
130 sunxi_gpio_set_cfgpin(pin, SUN8I_GPG_SDC1);
131 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
132 sunxi_gpio_set_drv(pin, 2);
133 }
134 }
135#endif
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100136 break;
137
138 case 2:
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +0100139 pins = sunxi_name_to_gpio_bank(CONFIG_MMC2_PINS);
140
141#if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I)
142 /* SDC2: PC6-PC11 */
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100143 for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(11); pin++) {
Paul Kocialkowskiae358a42015-03-22 18:12:22 +0100144 sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100145 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
146 sunxi_gpio_set_drv(pin, 2);
147 }
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +0100148#elif defined(CONFIG_MACH_SUN5I)
149 if (pins == SUNXI_GPIO_E) {
150 /* SDC2: PE4-PE9 */
151 for (pin = SUNXI_GPE(4); pin <= SUNXI_GPD(9); pin++) {
152 sunxi_gpio_set_cfgpin(pin, SUN5I_GPE_SDC2);
153 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
154 sunxi_gpio_set_drv(pin, 2);
155 }
156 } else {
157 /* SDC2: PC6-PC15 */
158 for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(15); pin++) {
159 sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
160 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
161 sunxi_gpio_set_drv(pin, 2);
162 }
163 }
164#elif defined(CONFIG_MACH_SUN6I)
165 if (pins == SUNXI_GPIO_A) {
166 /* SDC2: PA9-PA14 */
167 for (pin = SUNXI_GPA(9); pin <= SUNXI_GPA(14); pin++) {
168 sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_SDC2);
169 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
170 sunxi_gpio_set_drv(pin, 2);
171 }
172 } else {
173 /* SDC2: PC6-PC15, PC24 */
174 for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(15); pin++) {
175 sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
176 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
177 sunxi_gpio_set_drv(pin, 2);
178 }
179
180 sunxi_gpio_set_cfgpin(SUNXI_GPC(24), SUNXI_GPC_SDC2);
181 sunxi_gpio_set_pull(SUNXI_GPC(24), SUNXI_GPIO_PULL_UP);
182 sunxi_gpio_set_drv(SUNXI_GPC(24), 2);
183 }
184#elif defined(CONFIG_MACH_SUN8I)
185 /* SDC2: PC5-PC6, PC8-PC16 */
186 for (pin = SUNXI_GPC(5); pin <= SUNXI_GPC(6); pin++) {
187 sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
188 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
189 sunxi_gpio_set_drv(pin, 2);
190 }
191
192 for (pin = SUNXI_GPC(8); pin <= SUNXI_GPC(16); pin++) {
193 sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
194 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
195 sunxi_gpio_set_drv(pin, 2);
196 }
197#endif
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100198 break;
199
200 case 3:
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +0100201 pins = sunxi_name_to_gpio_bank(CONFIG_MMC3_PINS);
202
203#if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I)
204 /* SDC3: PI4-PI9 */
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100205 for (pin = SUNXI_GPI(4); pin <= SUNXI_GPI(9); pin++) {
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +0100206 sunxi_gpio_set_cfgpin(pin, SUNXI_GPI_SDC3);
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100207 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
208 sunxi_gpio_set_drv(pin, 2);
209 }
Paul Kocialkowskid390d8c2015-03-22 18:12:23 +0100210#elif defined(CONFIG_MACH_SUN6I)
211 if (pins == SUNXI_GPIO_A) {
212 /* SDC3: PA9-PA14 */
213 for (pin = SUNXI_GPA(9); pin <= SUNXI_GPA(14); pin++) {
214 sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_SDC3);
215 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
216 sunxi_gpio_set_drv(pin, 2);
217 }
218 } else {
219 /* SDC3: PC6-PC15, PC24 */
220 for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(15); pin++) {
221 sunxi_gpio_set_cfgpin(pin, SUN6I_GPC_SDC3);
222 sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
223 sunxi_gpio_set_drv(pin, 2);
224 }
225
226 sunxi_gpio_set_cfgpin(SUNXI_GPC(24), SUN6I_GPC_SDC3);
227 sunxi_gpio_set_pull(SUNXI_GPC(24), SUNXI_GPIO_PULL_UP);
228 sunxi_gpio_set_drv(SUNXI_GPC(24), 2);
229 }
230#endif
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100231 break;
232
233 default:
234 printf("sunxi: invalid MMC slot %d for pinmux setup\n", sdc);
235 break;
236 }
237}
238
239int board_mmc_init(bd_t *bis)
240{
Hans de Goede63deaa82014-10-02 21:13:54 +0200241 __maybe_unused struct mmc *mmc0, *mmc1;
242 __maybe_unused char buf[512];
243
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100244 mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
Hans de Goede63deaa82014-10-02 21:13:54 +0200245 mmc0 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT);
246 if (!mmc0)
247 return -1;
248
Hans de Goedeaf593e42014-10-02 20:43:50 +0200249#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100250 mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
Hans de Goede63deaa82014-10-02 21:13:54 +0200251 mmc1 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA);
252 if (!mmc1)
253 return -1;
254#endif
255
256#if CONFIG_MMC_SUNXI_SLOT == 0 && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
257 /*
258 * Both mmc0 and mmc2 are bootable, figure out where we're booting
259 * from. Try mmc0 first, just like the brom does.
260 */
261 if (mmc_getcd(mmc0) && mmc_init(mmc0) == 0 &&
262 mmc0->block_dev.block_read(0, 16, 1, buf) == 1) {
263 buf[12] = 0;
264 if (strcmp(&buf[4], "eGON.BT0") == 0)
265 return 0;
266 }
267
268 /* no bootable card in mmc0, so we must be booting from mmc2, swap */
269 mmc0->block_dev.dev = 1;
270 mmc1->block_dev.dev = 0;
Ian Campbellb4e9f2f2014-05-05 14:42:31 +0100271#endif
272
273 return 0;
274}
275#endif
276
Hans de Goede3352b222014-06-13 22:55:49 +0200277void i2c_init_board(void)
278{
Paul Kocialkowskiae358a42015-03-22 18:12:22 +0100279 sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUNXI_GPB_TWI0);
280 sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUNXI_GPB_TWI0);
Hans de Goede3352b222014-06-13 22:55:49 +0200281 clock_twi_onoff(0, 1);
Hans de Goedea5b4cfe2015-02-16 17:23:25 +0100282#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
283 soft_i2c_gpio_sda = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_PANEL_I2C_SDA);
284 soft_i2c_gpio_scl = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_PANEL_I2C_SCL);
285#endif
Hans de Goede3352b222014-06-13 22:55:49 +0200286}
287
Ian Campbell6efe3692014-05-05 11:52:26 +0100288#ifdef CONFIG_SPL_BUILD
289void sunxi_board_init(void)
290{
Henrik Nordstromaa382ad2014-06-13 22:55:50 +0200291 int power_failed = 0;
Ian Campbell6efe3692014-05-05 11:52:26 +0100292 unsigned long ramsize;
293
Hans de Goede1f247362014-06-13 22:55:51 +0200294#ifdef CONFIG_AXP152_POWER
295 power_failed = axp152_init();
296 power_failed |= axp152_set_dcdc2(1400);
297 power_failed |= axp152_set_dcdc3(1500);
298 power_failed |= axp152_set_dcdc4(1250);
299 power_failed |= axp152_set_ldo2(3000);
300#endif
Henrik Nordstromaa382ad2014-06-13 22:55:50 +0200301#ifdef CONFIG_AXP209_POWER
302 power_failed |= axp209_init();
303 power_failed |= axp209_set_dcdc2(1400);
304 power_failed |= axp209_set_dcdc3(1250);
305 power_failed |= axp209_set_ldo2(3000);
306 power_failed |= axp209_set_ldo3(2800);
307 power_failed |= axp209_set_ldo4(2800);
308#endif
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200309#ifdef CONFIG_AXP221_POWER
310 power_failed = axp221_init();
Hans de Goede78655482014-12-13 14:12:06 +0100311 power_failed |= axp221_set_dcdc1(CONFIG_AXP221_DCDC1_VOLT);
Hans de Goede013c9ce2014-12-13 14:20:09 +0100312 power_failed |= axp221_set_dcdc2(1200); /* A31:VDD-GPU, A23:VDD-SYS */
313 power_failed |= axp221_set_dcdc3(1200); /* VDD-CPU */
314#ifdef CONFIG_MACH_SUN6I
315 power_failed |= axp221_set_dcdc4(1200); /* A31:VDD-SYS */
316#else
317 power_failed |= axp221_set_dcdc4(0); /* A23:unused */
318#endif
319 power_failed |= axp221_set_dcdc5(1500); /* VCC-DRAM */
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200320 power_failed |= axp221_set_dldo1(CONFIG_AXP221_DLDO1_VOLT);
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200321 power_failed |= axp221_set_dldo4(CONFIG_AXP221_DLDO4_VOLT);
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200322 power_failed |= axp221_set_aldo1(CONFIG_AXP221_ALDO1_VOLT);
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200323 power_failed |= axp221_set_aldo2(CONFIG_AXP221_ALDO2_VOLT);
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200324 power_failed |= axp221_set_aldo3(CONFIG_AXP221_ALDO3_VOLT);
Siarhei Siamashka7e4eb6c2015-01-19 05:23:30 +0200325 power_failed |= axp221_set_eldo(3, CONFIG_AXP221_ELDO3_VOLT);
Oliver Schinagld3a558d2013-07-26 12:56:58 +0200326#endif
Henrik Nordstromaa382ad2014-06-13 22:55:50 +0200327
Ian Campbell6efe3692014-05-05 11:52:26 +0100328 printf("DRAM:");
329 ramsize = sunxi_dram_init();
330 printf(" %lu MiB\n", ramsize >> 20);
331 if (!ramsize)
332 hang();
Henrik Nordstromaa382ad2014-06-13 22:55:50 +0200333
334 /*
335 * Only clock up the CPU to full speed if we are reasonably
336 * assured it's being powered with suitable core voltage
337 */
338 if (!power_failed)
Iain Paton630df142015-03-28 10:26:38 +0000339 clock_set_pll1(CONFIG_SYS_CLK_FREQ);
Henrik Nordstromaa382ad2014-06-13 22:55:50 +0200340 else
341 printf("Failed to set core voltage! Can't set CPU frequency\n");
Ian Campbell6efe3692014-05-05 11:52:26 +0100342}
343#endif
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200344
Hans de Goedef494cad2015-01-11 17:17:00 +0100345#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
346static struct musb_hdrc_config musb_config = {
347 .multipoint = 1,
348 .dyn_fifo = 1,
349 .num_eps = 6,
350 .ram_bits = 11,
351};
352
353static struct musb_hdrc_platform_data musb_plat = {
354#if defined(CONFIG_MUSB_HOST)
355 .mode = MUSB_HOST,
356#else
357 .mode = MUSB_PERIPHERAL,
358#endif
359 .config = &musb_config,
360 .power = 250,
361 .platform_ops = &sunxi_musb_ops,
362};
363#endif
364
Paul Kocialkowskidbbccaf2015-03-22 18:07:13 +0100365#ifdef CONFIG_USB_GADGET
366int g_dnl_board_usb_cable_connected(void)
367{
368 return sunxi_usbc_vbus_detect(0);
369}
370#endif
371
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200372#ifdef CONFIG_MISC_INIT_R
373int misc_init_r(void)
374{
Paul Kocialkowski92935942015-03-28 18:35:35 +0100375 char serial_string[17] = { 0 };
Hans de Goede11d70982014-11-26 00:04:24 +0100376 unsigned int sid[4];
Paul Kocialkowski92935942015-03-28 18:35:35 +0100377 uint8_t mac_addr[6];
378 int ret;
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200379
Paul Kocialkowski92935942015-03-28 18:35:35 +0100380 ret = sunxi_get_sid(sid);
381 if (ret == 0 && sid[0] != 0 && sid[3] != 0) {
382 if (!getenv("ethaddr")) {
383 /* Non OUI / registered MAC address */
384 mac_addr[0] = 0x02;
385 mac_addr[1] = (sid[0] >> 0) & 0xff;
386 mac_addr[2] = (sid[3] >> 24) & 0xff;
387 mac_addr[3] = (sid[3] >> 16) & 0xff;
388 mac_addr[4] = (sid[3] >> 8) & 0xff;
389 mac_addr[5] = (sid[3] >> 0) & 0xff;
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200390
Paul Kocialkowski92935942015-03-28 18:35:35 +0100391 eth_setenv_enetaddr("ethaddr", mac_addr);
392 }
393
394 if (!getenv("serial#")) {
395 snprintf(serial_string, sizeof(serial_string),
396 "%08x%08x", sid[0], sid[3]);
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200397
Paul Kocialkowski92935942015-03-28 18:35:35 +0100398 setenv("serial#", serial_string);
399 }
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200400 }
401
Hans de Goedef494cad2015-01-11 17:17:00 +0100402#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
403 musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
404#endif
Jonathan Liuabc1aae2014-06-14 08:59:09 +0200405 return 0;
406}
407#endif
Luc Verhaegen4869a8c2014-08-13 07:55:07 +0200408
409#ifdef CONFIG_OF_BOARD_SETUP
410int ft_board_setup(void *blob, bd_t *bd)
411{
412#ifdef CONFIG_VIDEO_DT_SIMPLEFB
413 return sunxi_simplefb_setup(blob);
414#endif
415}
416#endif /* CONFIG_OF_BOARD_SETUP */