1 // SPDX-License-Identifier: GPL-2.0+
3 * Amazon Kindle Fire (first generation) codename kc1 config
5 * Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
12 #include <linux/ctype.h>
13 #include <linux/usb/musb.h>
14 #include <asm/omap_musb.h>
15 #include <asm/arch/sys_proto.h>
16 #include <asm/arch/mmc_host_def.h>
21 #include <asm/mach-types.h>
23 DECLARE_GLOBAL_DATA_PTR;
25 const struct omap_sysinfo sysinfo = {
29 static struct musb_hdrc_config musb_config = {
36 static struct omap_musb_board_data musb_board_data = {
37 .interface_type = MUSB_INTERFACE_UTMI,
40 static struct musb_hdrc_platform_data musb_platform_data = {
41 .mode = MUSB_PERIPHERAL,
42 .config = &musb_config,
44 .platform_ops = &omap2430_ops,
45 .board_data = &musb_board_data,
49 void set_muxconf_regs(void)
51 do_set_mux((*ctrl)->control_padconf_core_base, core_padconf_array,
52 sizeof(core_padconf_array) / sizeof(struct pad_conf_entry));
55 struct lpddr2_device_details *emif_get_device_details(u32 emif_nr, u8 cs,
56 struct lpddr2_device_details *lpddr2_dev_details)
61 *lpddr2_dev_details = elpida_2G_S4_details;
63 return lpddr2_dev_details;
66 void emif_get_device_timings(u32 emif_nr,
67 const struct lpddr2_device_timings **cs0_device_timings,
68 const struct lpddr2_device_timings **cs1_device_timings)
70 *cs0_device_timings = &elpida_2G_S4_timings;
71 *cs1_device_timings = NULL;
80 gd->bd->bi_arch_number = MACH_TYPE_OMAP_4430SDP;
83 gd->bd->bi_boot_params = OMAP44XX_DRAM_ADDR_SPACE_START + 0x100;
90 char reboot_mode[2] = { 0 };
97 rc = omap_reboot_mode(reboot_mode, sizeof(reboot_mode));
99 /* USB ID pin pull-up indicates factory (fastboot) cable detection. */
100 gpio_request(KC1_GPIO_USB_ID, "USB_ID");
101 gpio_direction_input(KC1_GPIO_USB_ID);
102 value = gpio_get_value(KC1_GPIO_USB_ID);
105 reboot_mode[0] = 'b';
107 if (rc < 0 || reboot_mode[0] == 'o') {
109 * When not rebooting, valid power on reasons are either the
110 * power button, charger plug or USB plug.
113 data |= twl6030_input_power_button();
114 data |= twl6030_input_charger();
115 data |= twl6030_input_usb();
121 if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) {
122 if (!env_get("reboot-mode"))
123 env_set("reboot-mode", (char *)reboot_mode);
126 omap_reboot_mode_clear();
130 omap_die_id_serial();
134 musb_register(&musb_platform_data, &musb_board_data, (void *)MUSB_BASE);
139 u32 get_board_rev(void)
143 gpio_request(KC1_GPIO_MBID0, "MBID0");
144 gpio_request(KC1_GPIO_MBID1, "MBID1");
145 gpio_request(KC1_GPIO_MBID2, "MBID2");
146 gpio_request(KC1_GPIO_MBID3, "MBID3");
148 gpio_direction_input(KC1_GPIO_MBID0);
149 gpio_direction_input(KC1_GPIO_MBID1);
150 gpio_direction_input(KC1_GPIO_MBID2);
151 gpio_direction_input(KC1_GPIO_MBID3);
153 value |= (gpio_get_value(KC1_GPIO_MBID0) << 0);
154 value |= (gpio_get_value(KC1_GPIO_MBID1) << 1);
155 value |= (gpio_get_value(KC1_GPIO_MBID2) << 2);
156 value |= (gpio_get_value(KC1_GPIO_MBID3) << 3);
161 void get_board_serial(struct tag_serialnr *serialnr)
163 omap_die_id_get_board_serial(serialnr);
166 int fastboot_set_reboot_flag(void)
168 return omap_reboot_mode_store("b");
171 int board_mmc_init(bd_t *bis)
173 return omap_mmc_init(1, 0, 0, -1, -1);
176 void board_mmc_power_init(void)
178 twl6030_power_mmc_init(1);