Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16751
b: refs/heads/master
c: 3145d8a
h: refs/heads/master
i:
  16749: 4907c24
  16747: 6fff5b3
  16743: 7ef5083
  16735: 54e15f3
v: v3
  • Loading branch information
Rod Whitby authored and Russell King committed Jan 4, 2006
1 parent cd506d0 commit fe8e640
Show file tree
Hide file tree
Showing 9 changed files with 374 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7e8bbb8207c17afbd716e7e5fc785b78fa08571
refs/heads/master: 3145d8a6cc83ee15adf18f598873e53a54cd1841
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ config ARCH_PRPMC1100
PrPCM1100 Processor Mezanine Module. For more information on
this platform, see <file:Documentation/arm/IXP4xx>.

config MACH_NAS100D
bool
prompt "NAS100D"
help
Say 'Y' here if you want your kernel to support Iomega's
NAS 100d device. For more information on this platform,
see http://www.nslu2-linux.org/wiki/NAS100d/HomePage

#
# Avila and IXDP share the same source for now. Will change in future
#
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-ixp4xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ obj-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o coyote-setup.o
obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o coyote-setup.o
obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o
obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o
obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o

77 changes: 77 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/nas100d-pci.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* arch/arm/mach-ixp4xx/nas100d-pci.c
*
* NAS 100d board-level PCI initialization
*
* based on ixdp425-pci.c:
* Copyright (C) 2002 Intel Corporation.
* Copyright (C) 2003-2004 MontaVista Software, Inc.
*
* Maintainer: http://www.nslu2-linux.org/
*
* 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/config.h>
#include <linux/pci.h>
#include <linux/init.h>

#include <asm/mach/pci.h>
#include <asm/mach-types.h>

void __init nas100d_pci_preinit(void)
{
set_irq_type(IRQ_NAS100D_PCI_INTA, IRQT_LOW);
set_irq_type(IRQ_NAS100D_PCI_INTB, IRQT_LOW);
set_irq_type(IRQ_NAS100D_PCI_INTC, IRQT_LOW);
set_irq_type(IRQ_NAS100D_PCI_INTD, IRQT_LOW);
set_irq_type(IRQ_NAS100D_PCI_INTE, IRQT_LOW);

gpio_line_isr_clear(NAS100D_PCI_INTA_PIN);
gpio_line_isr_clear(NAS100D_PCI_INTB_PIN);
gpio_line_isr_clear(NAS100D_PCI_INTC_PIN);
gpio_line_isr_clear(NAS100D_PCI_INTD_PIN);
gpio_line_isr_clear(NAS100D_PCI_INTE_PIN);

ixp4xx_pci_preinit();
}

static int __init nas100d_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
static int pci_irq_table[NAS100D_PCI_MAX_DEV][NAS100D_PCI_IRQ_LINES] =
{
{ IRQ_NAS100D_PCI_INTA, -1, -1 },
{ IRQ_NAS100D_PCI_INTB, -1, -1 },
{ IRQ_NAS100D_PCI_INTC, IRQ_NAS100D_PCI_INTD, IRQ_NAS100D_PCI_INTE },
};

int irq = -1;

if (slot >= 1 && slot <= NAS100D_PCI_MAX_DEV &&
pin >= 1 && pin <= NAS100D_PCI_IRQ_LINES)
irq = pci_irq_table[slot-1][pin-1];

return irq;
}

struct hw_pci __initdata nas100d_pci = {
.nr_controllers = 1,
.preinit = nas100d_pci_preinit,
.swizzle = pci_std_swizzle,
.setup = ixp4xx_setup,
.scan = ixp4xx_scan_bus,
.map_irq = nas100d_map_irq,
};

int __init nas100d_pci_init(void)
{
if (machine_is_nas100d())
pci_common_init(&nas100d_pci);

return 0;
}

subsys_initcall(nas100d_pci_init);
69 changes: 69 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/nas100d-power.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* arch/arm/mach-ixp4xx/nas100d-power.c
*
* NAS 100d Power/Reset driver
*
* Copyright (C) 2005 Tower Technologies
*
* based on nas100d-io.c
* Copyright (C) 2004 Karen Spearel
*
* Author: Alessandro Zummo <a.zummo@towertech.it>
* Maintainers: http://www.nslu2-linux.org/
*
* 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/module.h>
#include <linux/reboot.h>
#include <linux/interrupt.h>

#include <asm/mach-types.h>

extern void ctrl_alt_del(void);

static irqreturn_t nas100d_reset_handler(int irq, void *dev_id, struct pt_regs *regs)
{
/* Signal init to do the ctrlaltdel action, this will bypass init if
* it hasn't started and do a kernel_restart.
*/
ctrl_alt_del();

return IRQ_HANDLED;
}

static int __init nas100d_power_init(void)
{
if (!(machine_is_nas100d()))
return 0;

set_irq_type(NAS100D_RB_IRQ, IRQT_LOW);

gpio_line_isr_clear(NAS100D_RB_GPIO);

if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler,
SA_INTERRUPT, "NAS100D reset button", NULL) < 0) {

printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
NAS100D_RB_IRQ);

return -EIO;
}

return 0;
}

static void __exit nas100d_power_exit(void)
{
free_irq(NAS100D_RB_IRQ, NULL);
}

module_init(nas100d_power_init);
module_exit(nas100d_power_exit);

MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
MODULE_DESCRIPTION("NAS100D Power/Reset driver");
MODULE_LICENSE("GPL");
133 changes: 133 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/nas100d-setup.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* arch/arm/mach-ixp4xx/nas100d-setup.c
*
* NAS 100d board-setup
*
* based ixdp425-setup.c:
* Copyright (C) 2003-2004 MontaVista Software, Inc.
*
* Author: Alessandro Zummo <a.zummo@towertech.it>
* Author: Rod Whitby <rod@whitby.id.au>
* Maintainers: http://www.nslu2-linux.org/
*
*/

#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>

static struct flash_platform_data nas100d_flash_data = {
.map_name = "cfi_probe",
.width = 2,
};

static struct resource nas100d_flash_resource = {
.start = NAS100D_FLASH_BASE,
.end = NAS100D_FLASH_BASE + NAS100D_FLASH_SIZE,
.flags = IORESOURCE_MEM,
};

static struct platform_device nas100d_flash = {
.name = "IXP4XX-Flash",
.id = 0,
.dev.platform_data = &nas100d_flash_data,
.num_resources = 1,
.resource = &nas100d_flash_resource,
};

static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
.sda_pin = NAS100D_SDA_PIN,
.scl_pin = NAS100D_SCL_PIN,
};

static struct platform_device nas100d_i2c_controller = {
.name = "IXP4XX-I2C",
.id = 0,
.dev.platform_data = &nas100d_i2c_gpio_pins,
.num_resources = 0,
};

static struct resource nas100d_uart_resources[] = {
{
.start = IXP4XX_UART1_BASE_PHYS,
.end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
.flags = IORESOURCE_MEM,
},
{
.start = IXP4XX_UART2_BASE_PHYS,
.end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
.flags = IORESOURCE_MEM,
}
};

static struct plat_serial8250_port nas100d_uart_data[] = {
{
.mapbase = IXP4XX_UART1_BASE_PHYS,
.membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
.irq = IRQ_IXP4XX_UART1,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = IXP4XX_UART_XTAL,
},
{
.mapbase = IXP4XX_UART2_BASE_PHYS,
.membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
.irq = IRQ_IXP4XX_UART2,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = IXP4XX_UART_XTAL,
},
{ }
};

static struct platform_device nas100d_uart = {
.name = "serial8250",
.id = PLAT8250_DEV_PLATFORM,
.dev.platform_data = nas100d_uart_data,
.num_resources = 2,
.resource = nas100d_uart_resources,
};

static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_controller,
&nas100d_flash,
&nas100d_uart,
};

static void nas100d_power_off(void)
{
/* This causes the box to drop the power and go dead. */

/* enable the pwr cntl gpio */
gpio_line_config(NAS100D_PO_GPIO, IXP4XX_GPIO_OUT);

/* do the deed */
gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
}

static void __init nas100d_init(void)
{
ixp4xx_sys_init();

pm_power_off = nas100d_power_off;

platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
}

MACHINE_START(NAS100D, "Iomega NAS 100d")
/* Maintainer: www.nslu2-linux.org */
.phys_ram = PHYS_OFFSET,
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,
.init_machine = nas100d_init,
MACHINE_END
1 change: 1 addition & 0 deletions trunk/include/asm-arm/arch-ixp4xx/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ extern unsigned int processor_id;
#include "coyote.h"
#include "prpmc1100.h"
#include "nslu2.h"
#include "nas100d.h"

#endif /* _ASM_ARCH_HARDWARE_H */
9 changes: 9 additions & 0 deletions trunk/include/asm-arm/arch-ixp4xx/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,13 @@
#define IRQ_NSLU2_PCI_INTB IRQ_IXP4XX_GPIO10
#define IRQ_NSLU2_PCI_INTC IRQ_IXP4XX_GPIO9

/*
* NAS100D board IRQs
*/
#define IRQ_NAS100D_PCI_INTA IRQ_IXP4XX_GPIO11
#define IRQ_NAS100D_PCI_INTB IRQ_IXP4XX_GPIO10
#define IRQ_NAS100D_PCI_INTC IRQ_IXP4XX_GPIO9
#define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8
#define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7

#endif
Loading

0 comments on commit fe8e640

Please sign in to comment.