2 * LG Optimus Black (P970) codename sniper board
4 * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
6 * SPDX-License-Identifier: GPL-2.0+
12 #include <linux/ctype.h>
13 #include <asm/arch/mmc_host_def.h>
14 #include <asm/arch/sys_proto.h>
15 #include <asm/arch/mem.h>
21 DECLARE_GLOBAL_DATA_PTR;
23 const omap3_sysinfo sysinfo = {
25 .board_string = "Sniper",
29 static const struct ns16550_platdata serial_omap_platdata = {
30 .base = OMAP34XX_UART3,
32 .clock = V_NS16550_CLK
35 U_BOOT_DEVICE(sniper_serial) = {
36 .name = "serial_omap",
37 .platdata = &serial_omap_platdata
40 #ifdef CONFIG_SPL_BUILD
41 void get_board_mem_timings(struct board_sdrc_timings *timings)
43 timings->mcfg = HYNIX_V_MCFG_200(256 << 20);
44 timings->ctrla = HYNIX_V_ACTIMA_200;
45 timings->ctrlb = HYNIX_V_ACTIMB_200;
46 timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
47 timings->mr = MICRON_V_MR_165;
51 u32 get_board_rev(void)
53 /* Sold devices are expected to be at least revision F. */
63 gd->bd->bi_arch_number = 3000;
66 gd->bd->bi_boot_params = OMAP34XX_SDRC_CS0 + 0x100;
73 char serial_string[17] = { 0 };
74 char reboot_mode[2] = { 0 };
79 reboot_mode[0] = omap_reboot_mode();
80 if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) {
81 if (!getenv("reboot-mode"))
82 setenv("reboot-mode", (char *)reboot_mode);
84 omap_reboot_mode_clear();
89 get_dieid((u32 *)&dieid);
91 if (!getenv("serial#")) {
92 snprintf(serial_string, sizeof(serial_string),
93 "%08x%08x", dieid[0], dieid[3]);
95 setenv("serial#", serial_string);
101 void get_board_serial(struct tag_serialnr *serialnr)
104 unsigned long long serial;
106 serial_string = getenv("serial#");
109 serial = simple_strtoull(serial_string, NULL, 16);
111 serialnr->high = (unsigned int) (serial >> 32);
112 serialnr->low = (unsigned int) (serial & 0xffffffff);
119 void set_muxconf_regs(void)
124 #ifndef CONFIG_SPL_BUILD
125 int board_mmc_init(bd_t *bis)
127 return omap_mmc_init(1, 0, 0, -1, -1);
131 void board_mmc_power_init(void)
133 twl4030_power_mmc_init(1);