2 * Amazon Kindle Fire (first generation) codename kc1 config
4 * Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
6 * SPDX-License-Identifier: GPL-2.0+
11 #include <linux/ctype.h>
12 #include <linux/usb/musb.h>
13 #include <asm/omap_musb.h>
14 #include <asm/arch/sys_proto.h>
15 #include <asm/arch/mmc_host_def.h>
20 #include <asm/mach-types.h>
22 DECLARE_GLOBAL_DATA_PTR
;
24 const struct omap_sysinfo sysinfo
= {
28 static struct musb_hdrc_config musb_config
= {
35 static struct omap_musb_board_data musb_board_data
= {
36 .interface_type
= MUSB_INTERFACE_UTMI
,
39 static struct musb_hdrc_platform_data musb_platform_data
= {
40 .mode
= MUSB_PERIPHERAL
,
41 .config
= &musb_config
,
43 .platform_ops
= &omap2430_ops
,
44 .board_data
= &musb_board_data
,
48 void set_muxconf_regs(void)
50 do_set_mux((*ctrl
)->control_padconf_core_base
, core_padconf_array
,
51 sizeof(core_padconf_array
) / sizeof(struct pad_conf_entry
));
54 struct lpddr2_device_details
*emif_get_device_details(u32 emif_nr
, u8 cs
,
55 struct lpddr2_device_details
*lpddr2_dev_details
)
60 *lpddr2_dev_details
= elpida_2G_S4_details
;
62 return lpddr2_dev_details
;
65 void emif_get_device_timings(u32 emif_nr
,
66 const struct lpddr2_device_timings
**cs0_device_timings
,
67 const struct lpddr2_device_timings
**cs1_device_timings
)
69 *cs0_device_timings
= &elpida_2G_S4_timings
;
70 *cs1_device_timings
= NULL
;
79 gd
->bd
->bi_arch_number
= MACH_TYPE_OMAP_4430SDP
;
82 gd
->bd
->bi_boot_params
= OMAP44XX_DRAM_ADDR_SPACE_START
+ 0x100;
89 char reboot_mode
[2] = { 0 };
96 rc
= omap_reboot_mode(reboot_mode
, sizeof(reboot_mode
));
98 /* USB ID pin pull-up indicates factory (fastboot) cable detection. */
99 gpio_request(KC1_GPIO_USB_ID
, "USB_ID");
100 gpio_direction_input(KC1_GPIO_USB_ID
);
101 value
= gpio_get_value(KC1_GPIO_USB_ID
);
104 reboot_mode
[0] = 'b';
106 if (rc
< 0 || reboot_mode
[0] == 'o') {
108 * When not rebooting, valid power on reasons are either the
109 * power button, charger plug or USB plug.
112 data
|= twl6030_input_power_button();
113 data
|= twl6030_input_charger();
114 data
|= twl6030_input_usb();
120 if (reboot_mode
[0] > 0 && isascii(reboot_mode
[0])) {
121 if (!getenv("reboot-mode"))
122 env_set("reboot-mode", (char *)reboot_mode
);
125 omap_reboot_mode_clear();
129 omap_die_id_serial();
133 musb_register(&musb_platform_data
, &musb_board_data
, (void *)MUSB_BASE
);
138 u32
get_board_rev(void)
142 gpio_request(KC1_GPIO_MBID0
, "MBID0");
143 gpio_request(KC1_GPIO_MBID1
, "MBID1");
144 gpio_request(KC1_GPIO_MBID2
, "MBID2");
145 gpio_request(KC1_GPIO_MBID3
, "MBID3");
147 gpio_direction_input(KC1_GPIO_MBID0
);
148 gpio_direction_input(KC1_GPIO_MBID1
);
149 gpio_direction_input(KC1_GPIO_MBID2
);
150 gpio_direction_input(KC1_GPIO_MBID3
);
152 value
|= (gpio_get_value(KC1_GPIO_MBID0
) << 0);
153 value
|= (gpio_get_value(KC1_GPIO_MBID1
) << 1);
154 value
|= (gpio_get_value(KC1_GPIO_MBID2
) << 2);
155 value
|= (gpio_get_value(KC1_GPIO_MBID3
) << 3);
160 void get_board_serial(struct tag_serialnr
*serialnr
)
162 omap_die_id_get_board_serial(serialnr
);
165 int fb_set_reboot_flag(void)
167 return omap_reboot_mode_store("b");
170 int board_mmc_init(bd_t
*bis
)
172 return omap_mmc_init(1, 0, 0, -1, -1);
175 void board_mmc_power_init(void)
177 twl6030_power_mmc_init(1);