2009-03-13 09:37:09 -06:00
|
|
|
/*
|
|
|
|
* arch/arm/mach-pxa/colibri-pxa300.c
|
|
|
|
*
|
2009-03-22 19:04:17 -06:00
|
|
|
* Support for Toradex PXA300/310 based Colibri module
|
|
|
|
*
|
2009-03-13 09:37:09 -06:00
|
|
|
* Daniel Mack <daniel@caiaq.de>
|
2009-03-22 19:04:17 -06:00
|
|
|
* Matthias Meier <matthias.j.meier@gmx.net>
|
2009-03-13 09:37:09 -06:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/gpio.h>
|
|
|
|
#include <net/ax88796.h>
|
|
|
|
|
|
|
|
#include <asm/mach-types.h>
|
2009-03-22 19:04:17 -06:00
|
|
|
#include <asm/sizes.h>
|
2009-03-13 09:37:09 -06:00
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/irq.h>
|
|
|
|
|
|
|
|
#include <mach/pxa300.h>
|
|
|
|
#include <mach/colibri.h>
|
2009-03-13 09:37:11 -06:00
|
|
|
#include <mach/ohci.h>
|
2009-03-13 09:37:09 -06:00
|
|
|
|
|
|
|
#include "generic.h"
|
|
|
|
#include "devices.h"
|
|
|
|
|
|
|
|
#if defined(CONFIG_AX88796)
|
2009-03-22 19:04:17 -06:00
|
|
|
#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
|
2009-03-13 09:37:09 -06:00
|
|
|
/*
|
|
|
|
* Asix AX88796 Ethernet
|
|
|
|
*/
|
|
|
|
static struct ax_plat_data colibri_asix_platdata = {
|
|
|
|
.flags = AXFLG_MAC_FROMDEV,
|
2009-03-22 19:04:16 -06:00
|
|
|
.wordlength = 2
|
2009-03-13 09:37:09 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource colibri_asix_resource[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = PXA3xx_CS2_PHYS,
|
2009-03-22 19:04:16 -06:00
|
|
|
.end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1,
|
2009-03-13 09:37:09 -06:00
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
2009-03-22 19:04:17 -06:00
|
|
|
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
|
|
|
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
|
2009-03-13 09:37:09 -06:00
|
|
|
.flags = IORESOURCE_IRQ
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device asix_device = {
|
|
|
|
.name = "ax88796",
|
|
|
|
.id = 0,
|
|
|
|
.num_resources = ARRAY_SIZE(colibri_asix_resource),
|
|
|
|
.resource = colibri_asix_resource,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &colibri_asix_platdata
|
|
|
|
}
|
|
|
|
};
|
2009-03-13 09:37:10 -06:00
|
|
|
|
2009-03-22 19:04:17 -06:00
|
|
|
static mfp_cfg_t colibri_pxa300_eth_pin_config[] __initdata = {
|
|
|
|
GPIO1_nCS2, /* AX88796 chip select */
|
|
|
|
GPIO26_GPIO | MFP_PULL_HIGH /* AX88796 IRQ */
|
2009-03-13 09:37:10 -06:00
|
|
|
};
|
|
|
|
|
2009-03-22 19:04:17 -06:00
|
|
|
static void __init colibri_pxa300_init_eth(void)
|
2009-03-13 09:37:10 -06:00
|
|
|
{
|
2009-03-22 19:04:17 -06:00
|
|
|
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config));
|
|
|
|
set_irq_type(gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), IRQ_TYPE_EDGE_FALLING);
|
|
|
|
platform_device_register(&asix_device);
|
2009-03-13 09:37:10 -06:00
|
|
|
}
|
|
|
|
#else
|
2009-03-22 19:04:17 -06:00
|
|
|
static inline void __init colibri_pxa300_init_eth(void) {}
|
|
|
|
#endif /* CONFIG_AX88796 */
|
2009-03-13 09:37:10 -06:00
|
|
|
|
2009-03-13 09:37:11 -06:00
|
|
|
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
|
2009-03-22 19:04:17 -06:00
|
|
|
static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = {
|
|
|
|
GPIO0_2_USBH_PEN,
|
|
|
|
GPIO1_2_USBH_PWR,
|
|
|
|
};
|
|
|
|
|
2009-03-13 09:37:11 -06:00
|
|
|
static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
|
|
|
|
.port_mode = PMM_GLOBAL_MODE,
|
|
|
|
.flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
|
|
|
|
};
|
|
|
|
|
2009-03-22 19:04:17 -06:00
|
|
|
void __init colibri_pxa300_init_ohci(void)
|
2009-03-13 09:37:11 -06:00
|
|
|
{
|
2009-03-22 19:04:17 -06:00
|
|
|
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config));
|
2009-03-13 09:37:11 -06:00
|
|
|
pxa_set_ohci_info(&colibri_pxa300_ohci_info);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline void colibri_pxa300_init_ohci(void) {}
|
|
|
|
#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
|
|
|
|
|
2009-03-22 19:04:17 -06:00
|
|
|
static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
|
|
|
|
GPIO7_MMC1_CLK,
|
|
|
|
GPIO14_MMC1_CMD,
|
|
|
|
GPIO3_MMC1_DAT0,
|
|
|
|
GPIO4_MMC1_DAT1,
|
|
|
|
GPIO5_MMC1_DAT2,
|
|
|
|
GPIO6_MMC1_DAT3,
|
|
|
|
};
|
|
|
|
|
|
|
|
void __init colibri_pxa300_init(void)
|
2009-03-13 09:37:09 -06:00
|
|
|
{
|
2009-03-22 19:04:17 -06:00
|
|
|
colibri_pxa300_init_eth();
|
2009-03-13 09:37:11 -06:00
|
|
|
colibri_pxa300_init_ohci();
|
2009-03-22 19:04:17 -06:00
|
|
|
colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config),
|
|
|
|
mfp_to_gpio(MFP_PIN_GPIO13));
|
2009-03-13 09:37:09 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
|
|
|
|
.phys_io = 0x40000000,
|
|
|
|
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
|
|
|
.boot_params = COLIBRI_SDRAM_BASE + 0x100,
|
|
|
|
.init_machine = colibri_pxa300_init,
|
|
|
|
.map_io = pxa_map_io,
|
|
|
|
.init_irq = pxa3xx_init_irq,
|
|
|
|
.timer = &pxa_timer,
|
|
|
|
MACHINE_END
|
|
|
|
|