23 #include <linux/kernel.h>
28 #include <linux/input.h>
32 #include <asm/bootinfo.h>
33 #include <asm/reboot.h>
45 unsigned char *memsize_str;
67 static void mtx1_reset(
char *
c)
70 __asm__ __volatile__(
"jr\t%0" : :
"r"(0xbfc00000));
73 static void mtx1_power_off(
void)
84 #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
86 alchemy_gpio_direction_output(204, 0);
94 alchemy_gpio_direction_output(0, 0);
95 alchemy_gpio_direction_output(3, 1);
96 alchemy_gpio_direction_output(1, 1);
97 alchemy_gpio_direction_output(5, 0);
100 alchemy_gpio_direction_output(211, 1);
101 alchemy_gpio_direction_output(212, 0);
116 .desc =
"System button",
121 .buttons = mtx1_gpio_button,
129 .platform_data = &mtx1_buttons_data,
133 static struct resource mtx1_wdt_res[] = {
137 .name =
"mtx1-wdt-gpio",
146 .resource = mtx1_wdt_res,
149 static struct gpio_led default_leds[] = {
151 .name =
"mtx1:green",
161 .leds = default_leds,
168 .platform_data = &mtx1_led_data,
174 .name =
"filesystem",
199 .parts = mtx1_mtd_partitions,
202 static struct resource mtx1_mtd_resource = {
209 .name =
"physmap-flash",
211 .platform_data = &mtx1_flash_data,
214 .resource = &mtx1_mtd_resource,
217 static struct resource alchemy_pci_host_res[] = {
225 static int mtx1_pci_idsel(
unsigned int devsel,
int assert)
233 if (assert && devsel != 0)
235 alchemy_gpio_set_value(1, 0);
237 alchemy_gpio_set_value(1, 1);
243 static const char mtx1_irqtab[][5] = {
260 .board_map_irq = mtx1_map_pci_irq,
261 .board_pci_idsel = mtx1_pci_idsel,
264 #if defined(__MIPSEB__)
272 .dev.platform_data = &mtx1_pci_pd,
273 .name =
"alchemy-pci",
275 .num_resources =
ARRAY_SIZE(alchemy_pci_host_res),
276 .resource = alchemy_pci_host_res,
288 .phy_search_highest_addr = 1,
289 .phy1_search_mac0 = 1,
292 static int __init mtx1_register_devices(
void)
305 mtx1_gpio_button[0].
desc);
308 mtx1_gpio_button[0].
gpio);