4 * ZyXEL Prestige P-334/P-335 boards
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
18 #include <asm/bootinfo.h>
21 #include <adm5120_board.h>
22 #include <adm5120_platform.h>
23 #include <adm5120_irq.h>
25 static void switch_bank_gpio5(unsigned bank)
29 gpio_set_value(ADM5120_GPIO_PIN5, 0);
32 gpio_set_value(ADM5120_GPIO_PIN5, 1);
37 static struct adm5120_pci_irq p33x_pci_irqs[] __initdata = {
38 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
41 static struct mtd_partition p33x_partitions[] = {
46 .mask_flags = MTD_WRITEABLE,
49 .offset = MTDPART_OFS_APPEND,
53 .offset = MTDPART_OFS_APPEND,
55 .mask_flags = MTD_WRITEABLE,
58 .offset = MTDPART_OFS_APPEND,
59 .size = MTDPART_SIZ_FULL,
63 .size = MTDPART_SIZ_FULL,
67 static struct platform_device *p334_devices[] __initdata = {
68 &adm5120_flash0_device,
71 static struct platform_device *p335_devices[] __initdata = {
72 &adm5120_flash0_device,
76 static void __init p33x_setup(void)
78 gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
79 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
81 /* setup data for flash0 device */
82 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
83 adm5120_flash0_data.nr_parts = ARRAY_SIZE(p33x_partitions);
84 adm5120_flash0_data.parts = p33x_partitions;
86 /* TODO: setup mac address */
89 unsigned char p33x_vlans[6] __initdata = {
91 0x50, 0x48, 0x44, 0x42, 0x41, 0x00
94 ADM5120_BOARD_START(P334WT, "ZyXEL Prestige 334WT")
95 .board_setup = p33x_setup,
97 .eth_vlans = p33x_vlans,
98 .num_devices = ARRAY_SIZE(p334_devices),
99 .devices = p334_devices,
100 .pci_nr_irqs = ARRAY_SIZE(p33x_pci_irqs),
101 .pci_irq_map = p33x_pci_irqs,
104 ADM5120_BOARD_START(P335, "ZyXEL Prestige 335/335WT")
105 .board_setup = p33x_setup,
107 .eth_vlans = p33x_vlans,
108 .num_devices = ARRAY_SIZE(p335_devices),
109 .devices = p335_devices,
110 .pci_nr_irqs = ARRAY_SIZE(p33x_pci_irqs),
111 .pci_irq_map = p33x_pci_irqs,