-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
9 changed files
with
374 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: f7e8bbb8207c17afbd716e7e5fc785b78fa08571 | ||
refs/heads/master: 3145d8a6cc83ee15adf18f598873e53a54cd1841 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.