/* register built-in ethernet switch */
platform_device_register(&adm5120_switch_device);
+ if (adm5120_package_pqfp())
+ adm5120_gpiodev_resource.start &= ~0xf0;
+
+ platform_device_register(&adm5120_gpiodev_device);
+
/* setup PCI irq map */
adm5120_pci_set_irq_map(board->pci_nr_irqs, board->pci_irq_map);
#include <adm5120_platform.h>
#include <adm5120_irq.h>
+#define CAS6XX_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
+#define CAS7XX_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
+#define NFS_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
+
static void switch_bank_gpio5(unsigned bank)
{
switch (bank) {
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
adm5120_flash0_data.parts = cas6xx_partitions;
+ adm5120_gpiodev_resource.start &= ~CAS6XX_GPIO_DEV_MASK;
+
/* TODO: setup mac address */
}
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas7xx_partitions);
adm5120_flash0_data.parts = cas7xx_partitions;
+ adm5120_gpiodev_resource.start &= ~CAS7XX_GPIO_DEV_MASK;
+
/* TODO: setup mac address */
}
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
adm5120_flash0_data.parts = cas6xx_partitions;
+ adm5120_gpiodev_resource.start &= ~NFS_GPIO_DEV_MASK;
+
/* TODO: setup mac address */
}
#include <adm5120_platform.h>
#include <adm5120_irq.h>
+#define NP27G_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
+#define NP28G_GPIO_DEV_MASK ( 1 << ADM5120_GPIO_PIN5 \
+ | 1 << ADM5120_GPIO_PIN4)
+
+#define WP54_GPIO_DEV_MASK ( 1 << ADM5120_GPIO_PIN5 \
+ | 1 << ADM5120_GPIO_PIN3)
+
static struct adm5120_pci_irq wp54_pci_irqs[] __initdata = {
PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
};
/* setup data for flash0 device */
adm5120_flash0_data.switch_bank = switch_bank_gpio5;
+ adm5120_gpiodev_resource.start &= ~NP27G_GPIO_DEV_MASK;
/* TODO: setup mac address */
}
/* setup data for flash0 device */
adm5120_flash0_data.switch_bank = switch_bank_gpio5;
+ adm5120_gpiodev_resource.start &= ~NP28G_GPIO_DEV_MASK;
+
/* TODO: setup mac address */
}
adm5120_buttons[0].desc = "reset button";
adm5120_buttons[0].gpio = ADM5120_GPIO_PIN2;
+ adm5120_gpiodev_resource.start &= ~WP54_GPIO_DEV_MASK;
+
/* TODO: setup mac address */
}
#include <adm5120_platform.h>
#include <adm5120_info.h>
+#define EASY_PQFP_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN3)
+#define EASY_BGA_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
+
static void switch_bank_gpio3(unsigned bank)
{
switch (bank) {
adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
adm5120_flash0_data.parts = easy_partitions;
+ adm5120_gpiodev_resource.start &= ~EASY_PQFP_GPIO_DEV_MASK;
+
/* TODO: setup mac addresses */
}
adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
adm5120_flash0_data.parts = easy_partitions;
+ adm5120_gpiodev_resource.start &= ~EASY_BGA_GPIO_DEV_MASK;
+
/* TODO: setup mac addresses */
}
#define RB150_GPIO_NAND_NCE ADM5120_GPIO_PIN1
#define RB150_GPIO_NAND_CLE ADM5120_GPIO_P2L2
#define RB150_GPIO_NAND_ALE ADM5120_GPIO_P3L2
+#define RB150_GPIO_DEV_MASK ( 1 << RB150_GPIO_NAND_READY \
+ | 1 << RB150_GPIO_NAND_NCE \
+ | 1 << RB150_GPIO_NAND_CLE \
+ | 1 << RB150_GPIO_NAND_ALE)
#define RB150_NAND_DELAY 100
#define RB150_NAND_WRITE(v) \
writeb((v), (void __iomem *)KSEG1ADDR(RB150_NAND_BASE))
+#define RB153_GPIO_DEV_MASK ( 1 << ADM5120_GPIO_PIN0 \
+ | 1 << ADM5120_GPIO_PIN3 \
+ | 1 << ADM5120_GPIO_PIN4 )
+
/*--------------------------------------------------------------------------*/
static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = {
adm5120_buttons[0].desc = "reset button";
adm5120_buttons[0].gpio = ADM5120_GPIO_PIN1; /* FIXME: valid? */
+ adm5120_gpiodev_resource.start &= ~RB150_GPIO_DEV_MASK;
+
adm5120_flash0_data.window_size = 512*1024;
rb1xx_flash_setup();
adm5120_gpio_ew_enable();
rb1xx_setup();
+
+ adm5120_gpiodev_resource.start &= ~RB153_GPIO_DEV_MASK;
}
/*--------------------------------------------------------------------------*/
#include <adm5120_platform.h>
#include <adm5120_irq.h>
+#define P33X_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
+
static void switch_bank_gpio5(unsigned bank)
{
switch (bank) {
adm5120_flash0_data.nr_parts = ARRAY_SIZE(p33x_partitions);
adm5120_flash0_data.parts = p33x_partitions;
+ adm5120_gpiodev_resource.start &= ~P33X_GPIO_DEV_MASK;
/* TODO: setup mac address */
}
.dev.platform_data = &adm5120_buttons_data,
};
+/* GPIO char device */
+struct resource adm5120_gpiodev_resource = {
+ .start = 0x3fffff,
+};
+
+struct platform_device adm5120_gpiodev_device = {
+ .name = "GPIODEV",
+ .id = -1,
+ .num_resources = 1,
+ .resource = &adm5120_gpiodev_resource,
+};
+
void adm5120_uart_set_mctrl(struct amba_device *dev, void __iomem *base,
unsigned int mctrl)
{
#define ADM5120_NUM_BUTTONS 5
+extern struct resource adm5120_gpiodev_resource;
+
extern struct adm5120_flash_platform_data adm5120_flash0_data;
extern struct adm5120_flash_platform_data adm5120_flash1_data;
extern struct platform_nand_data adm5120_nand_data;
extern struct platform_device adm5120_hcd_device;
extern struct platform_device adm5120_switch_device;
extern struct platform_device adm5120_buttons_device;
+extern struct platform_device adm5120_gpiodev_device;
extern struct amba_device adm5120_uart0_device;
extern struct amba_device adm5120_uart1_device;