3 * ISEE 2007 SL, <www.iseebcn.com>
5 * SPDX-License-Identifier: GPL-2.0+
8 #include <status_led.h>
16 #include <asm/arch/mem.h>
17 #include <asm/arch/mmc_host_def.h>
18 #include <asm/arch/mux.h>
19 #include <asm/arch/sys_proto.h>
20 #include <asm/mach-types.h>
21 #include <linux/mtd/mtd.h>
22 #include <linux/mtd/nand.h>
23 #include <linux/mtd/onenand.h>
24 #include <jffs2/load_kernel.h>
26 #include <fdt_support.h>
29 static const struct ns16550_platdata igep_serial = {
30 .base = OMAP34XX_UART3,
32 .clock = V_NS16550_CLK,
33 .fcr = UART_FCR_DEFVAL,
36 U_BOOT_DEVICE(igep_uart) = {
41 int onenand_board_init(struct mtd_info *mtd)
43 if (gpmc_cs0_flash == MTD_DEV_TYPE_ONENAND) {
44 struct onenand_chip *this = mtd->priv;
45 this->base = (void *)CONFIG_SYS_ONENAND_BASE;
51 #if defined(CONFIG_CMD_NET)
52 static void reset_net_chip(int gpio)
54 if (!gpio_request(gpio, "eth nrst")) {
55 gpio_direction_output(gpio, 1);
57 gpio_set_value(gpio, 0);
59 gpio_set_value(gpio, 1);
65 * Routine: setup_net_chip
66 * Description: Setting up the configuration GPMC registers specific to the
69 static void setup_net_chip(void)
71 struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
72 static const u32 gpmc_lan_config[] = {
73 NET_LAN9221_GPMC_CONFIG1,
74 NET_LAN9221_GPMC_CONFIG2,
75 NET_LAN9221_GPMC_CONFIG3,
76 NET_LAN9221_GPMC_CONFIG4,
77 NET_LAN9221_GPMC_CONFIG5,
78 NET_LAN9221_GPMC_CONFIG6,
81 enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[5],
82 CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
84 /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
85 writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
86 /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
87 writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
88 /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
89 writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
90 &ctrl_base->gpmc_nadv_ale);
95 int board_eth_init(bd_t *bis)
98 return smc911x_initialize(0, CONFIG_SMC911X_BASE);
104 static inline void setup_net_chip(void) {}
107 #ifdef CONFIG_OF_BOARD_SETUP
108 static int ft_enable_by_compatible(void *blob, char *compat, int enable)
110 int off = fdt_node_offset_by_compatible(blob, -1, compat);
115 fdt_status_okay(blob, off);
117 fdt_status_disabled(blob, off);
122 int ft_board_setup(void *blob, bd_t *bd)
124 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
125 static struct node_info nodes[] = {
126 { "ti,omap2-nand", MTD_DEV_TYPE_NAND, },
127 { "ti,omap2-onenand", MTD_DEV_TYPE_ONENAND, },
130 fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
132 ft_enable_by_compatible(blob, "ti,omap2-nand",
133 gpmc_cs0_flash == MTD_DEV_TYPE_NAND);
134 ft_enable_by_compatible(blob, "ti,omap2-onenand",
135 gpmc_cs0_flash == MTD_DEV_TYPE_ONENAND);
143 switch (gd->bd->bi_arch_number) {
144 case MACH_TYPE_IGEP0020:
145 env_set("fdtfile", "omap3-igep0020.dtb");
147 case MACH_TYPE_IGEP0030:
148 env_set("fdtfile", "omap3-igep0030.dtb");
154 * Routine: misc_init_r
155 * Description: Configure board specific parts
157 int misc_init_r(void)
159 twl4030_power_init();
163 omap_die_id_display();
170 void board_mtdparts_default(const char **mtdids, const char **mtdparts)
172 struct mtd_info *mtd = get_mtd_device(NULL, 0);
175 static char parts[48];
176 const char *linux_name = "omap2-nand";
177 if (strncmp(mtd->name, "onenand0", 8) == 0)
178 linux_name = "omap2-onenand";
179 snprintf(ids, sizeof(ids), "%s=%s", mtd->name, linux_name);
180 snprintf(parts, sizeof(parts), "mtdparts=%s:%dk(SPL),-(UBI)",
181 linux_name, 4 * mtd->erasesize >> 10);