From e7068ad337a991fba627148a4a57939fdc1e6a2d Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Sat, 10 May 2008 16:30:01 +0200 Subject: [ARM] Orion: fix various whitespace and coding style issues More cosmetic cleanup: - Replace 8-space indents by proper tab indents. - In structure initialisers, use a trailing comma for every member. - Collapse "},\n{" in structure initialiers to "}, {". Signed-off-by: Lennert Buytenhek Acked-by: Russell King --- arch/arm/mach-orion5x/dns323-setup.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 27ce967ab9e..ec53f866ed1 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -119,7 +119,7 @@ static struct mtd_partition dns323_partitions[] = { .name = "u-boot", .size = 0x00030000, .offset = 0x007d0000, - } + }, }; static struct physmap_flash_data dns323_nor_flash_data = { @@ -137,7 +137,9 @@ static struct resource dns323_nor_flash_resource = { static struct platform_device dns323_nor_flash = { .name = "physmap-flash", .id = 0, - .dev = { .platform_data = &dns323_nor_flash_data, }, + .dev = { + .platform_data = &dns323_nor_flash_data, + }, .resource = &dns323_nor_flash_resource, .num_resources = 1, }; @@ -170,7 +172,9 @@ static struct gpio_led_platform_data dns323_led_data = { static struct platform_device dns323_gpio_leds = { .name = "leds-gpio", .id = -1, - .dev = { .platform_data = &dns323_led_data, }, + .dev = { + .platform_data = &dns323_led_data, + }, }; /**************************************************************************** @@ -183,25 +187,26 @@ static struct gpio_keys_button dns323_buttons[] = { .gpio = DNS323_GPIO_KEY_RESET, .desc = "Reset Button", .active_low = 1, - }, - { + }, { .code = KEY_POWER, .gpio = DNS323_GPIO_KEY_POWER, .desc = "Power Button", .active_low = 1, - } + }, }; static struct gpio_keys_platform_data dns323_button_data = { .buttons = dns323_buttons, - .nbuttons = ARRAY_SIZE(dns323_buttons), + .nbuttons = ARRAY_SIZE(dns323_buttons), }; static struct platform_device dns323_button_device = { .name = "gpio-keys", .id = -1, .num_resources = 0, - .dev = { .platform_data = &dns323_button_data, }, + .dev = { + .platform_data = &dns323_button_data, + }, }; /**************************************************************************** @@ -225,17 +230,15 @@ static struct platform_device *dns323_plat_devices[] __initdata = { static struct i2c_board_info __initdata dns323_i2c_devices[] = { { I2C_BOARD_INFO("g760a", 0x3e), - }, #if 0 /* this entry requires the new-style driver model lm75 driver, * for the meantime "insmod lm75.ko force_lm75=0,0x48" is needed */ - { + }, { I2C_BOARD_INFO("g751", 0x48), - }, #endif - { + }, { I2C_BOARD_INFO("m41t80", 0x68), - } + }, }; /* DNS-323 specific power off method */ @@ -292,8 +295,8 @@ static void __init dns323_init(void) orion5x_gpio_set_valid_pins(0x07f6); /* register dns323 specific power-off method */ - if ((gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0) - || (gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0)) + if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 || + gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0) pr_err("DNS323: failed to setup power-off GPIO\n"); pm_power_off = dns323_power_off; -- cgit v1.2.3 From 044f6c7c449ae8ba0353b032706b098a7ad5e304 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Tue, 22 Apr 2008 05:37:12 +0200 Subject: [ARM] Orion: move EHCI/I2C/UART peripheral init into board code This patch moves initialisation of EHCI/I2C/UART platform devices from the common orion5x_init() into the board support code. The rationale behind this is that only the board support code knows whether certain peripherals have been brought out on the board, and not initialising peripherals that haven't been brought out is desirable for example: - to reduce user confusion (e.g. seeing both 'eth0' and 'eth1' appear while there is only one ethernet port on the board); and - to allow for future power savings (peripherals that have not been brought out can be clock gated off entirely). Signed-off-by: Lennert Buytenhek Acked-by: Russell King --- arch/arm/mach-orion5x/dns323-setup.c | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index ec53f866ed1..cd200f76609 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -213,12 +213,6 @@ static struct platform_device dns323_button_device = { * General Setup */ -static struct platform_device *dns323_plat_devices[] __initdata = { - &dns323_nor_flash, - &dns323_gpio_leds, - &dns323_button_device, -}; - /* * On the DNS-323 the following devices are attached via I2C: * @@ -253,11 +247,6 @@ static void __init dns323_init(void) /* Setup basic Orion functions. Need to be called early. */ orion5x_init(); - /* setup flash mapping - * CS3 holds a 8 MB Spansion S29GL064M90TFIR4 - */ - orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE); - /* DNS-323 has a Marvell 88X7042 SATA controller attached via PCIe * * Open a special address decode windows for the PCIe WA. @@ -294,21 +283,32 @@ static void __init dns323_init(void) */ orion5x_gpio_set_valid_pins(0x07f6); - /* register dns323 specific power-off method */ - if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 || - gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0) - pr_err("DNS323: failed to setup power-off GPIO\n"); + /* + * Configure peripherals. + */ + orion5x_ehci0_init(); + orion5x_eth_init(&dns323_eth_data); + orion5x_i2c_init(); + orion5x_uart0_init(); - pm_power_off = dns323_power_off; + /* setup flash mapping + * CS3 holds a 8 MB Spansion S29GL064M90TFIR4 + */ + orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE); + platform_device_register(&dns323_nor_flash); + + platform_device_register(&dns323_gpio_leds); - /* register flash and other platform devices */ - platform_add_devices(dns323_plat_devices, - ARRAY_SIZE(dns323_plat_devices)); + platform_device_register(&dns323_button_device); i2c_register_board_info(0, dns323_i2c_devices, ARRAY_SIZE(dns323_i2c_devices)); - orion5x_eth_init(&dns323_eth_data); + /* register dns323 specific power-off method */ + if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 || + gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0) + pr_err("DNS323: failed to setup power-off GPIO\n"); + pm_power_off = dns323_power_off; } /* Warning: D-Link uses a wrong mach-type (=526) in their bootloader */ -- cgit v1.2.3 From 386a048a1ea42ff9ac87ffa344c4c19a5cc59678 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Sat, 10 May 2008 17:01:18 +0200 Subject: [ARM] Orion: move setting up PCIe WA window into PCIe setup path It makes no sense to do PCIe WA window setup in the individual board support files while the decision whether or not to use the PCIe WA access method is made in a different place, in the PCIe support code. This patch moves the configuration of a PCIe WA window from the individual Orion board support files to the central Orion PCIe support code. Signed-off-by: Lennert Buytenhek Acked-by: Russell King --- arch/arm/mach-orion5x/dns323-setup.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index cd200f76609..9ec53501b2a 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -247,13 +247,6 @@ static void __init dns323_init(void) /* Setup basic Orion functions. Need to be called early. */ orion5x_init(); - /* DNS-323 has a Marvell 88X7042 SATA controller attached via PCIe - * - * Open a special address decode windows for the PCIe WA. - */ - orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE, - ORION5X_PCIE_WA_SIZE); - /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */ orion5x_write(MPP_0_7_CTRL, 0); orion5x_write(MPP_8_15_CTRL, 0); -- cgit v1.2.3 From 19cfd5c09f780ac870fd9d89201c4ebc0b22be81 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Sat, 10 May 2008 23:25:46 +0200 Subject: [ARM] Orion: rework MPP handling Instead of having board code poke directly into the MPP configuration registers, and separately calling orion5x_gpio_set_valid_pins() to indicate which MPP pins can be used as GPIO pins, introduce a helper function for configuring the roles of each of the MPP pins, and have that helper function handle gpio validity internally. Signed-off-by: Lennert Buytenhek Acked-by: Sylver Bruneau Acked-by: Russell King --- arch/arm/mach-orion5x/dns323-setup.c | 54 +++++++++++++++++------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 9ec53501b2a..05ce6604874 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -27,6 +27,7 @@ #include #include #include "common.h" +#include "mpp.h" #define DNS323_GPIO_LED_RIGHT_AMBER 1 #define DNS323_GPIO_LED_LEFT_AMBER 2 @@ -212,6 +213,29 @@ static struct platform_device dns323_button_device = { /**************************************************************************** * General Setup */ +static struct orion5x_mpp_mode dns323_mpp_modes[] __initdata = { + { 0, MPP_PCIE_RST_OUTn }, + { 1, MPP_GPIO }, /* right amber LED (sata ch0) */ + { 2, MPP_GPIO }, /* left amber LED (sata ch1) */ + { 3, MPP_UNUSED }, + { 4, MPP_GPIO }, /* power button LED */ + { 5, MPP_GPIO }, /* power button LED */ + { 6, MPP_GPIO }, /* GMT G751-2f overtemp */ + { 7, MPP_GPIO }, /* M41T80 nIRQ/OUT/SQW */ + { 8, MPP_GPIO }, /* triggers power off */ + { 9, MPP_GPIO }, /* power button switch */ + { 10, MPP_GPIO }, /* reset button switch */ + { 11, MPP_UNUSED }, + { 12, MPP_UNUSED }, + { 13, MPP_UNUSED }, + { 14, MPP_UNUSED }, + { 15, MPP_UNUSED }, + { 16, MPP_UNUSED }, + { 17, MPP_UNUSED }, + { 18, MPP_UNUSED }, + { 19, MPP_UNUSED }, + { -1 }, +}; /* * On the DNS-323 the following devices are attached via I2C: @@ -247,34 +271,8 @@ static void __init dns323_init(void) /* Setup basic Orion functions. Need to be called early. */ orion5x_init(); - /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */ - orion5x_write(MPP_0_7_CTRL, 0); - orion5x_write(MPP_8_15_CTRL, 0); - orion5x_write(MPP_16_19_CTRL, 0); - orion5x_write(MPP_DEV_CTRL, 0); - - /* Define used GPIO pins - - GPIO Map: - - | 0 | | PEX_RST_OUT (not controlled by GPIO) - | 1 | Out | right amber LED (= sata ch0 LED) (low-active) - | 2 | Out | left amber LED (= sata ch1 LED) (low-active) - | 3 | Out | //unknown// - | 4 | Out | power button LED (low-active, together with pin #5) - | 5 | Out | power button LED (low-active, together with pin #4) - | 6 | In | GMT G751-2f overtemp. shutdown signal (low-active) - | 7 | In | M41T80 nIRQ/OUT/SQW signal - | 8 | Out | triggers power off (high-active) - | 9 | In | power button switch (low-active) - | 10 | In | reset button switch (low-active) - | 11 | Out | //unknown// - | 12 | Out | //unknown// - | 13 | Out | //unknown// - | 14 | Out | //unknown// - | 15 | Out | //unknown// - */ - orion5x_gpio_set_valid_pins(0x07f6); + orion5x_mpp_conf(dns323_mpp_modes); + orion5x_write(MPP_DEV_CTRL, 0); /* DEV_D[31:16] */ /* * Configure peripherals. -- cgit v1.2.3 From b206ed0462b7112d07bb9f245bf49f5e95ff174a Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Fri, 6 Jun 2008 12:32:59 +0200 Subject: [ARM] Orion: remove error printks in ->map_irq() implementations If all PCI devices are working as expected, the error printks in the various implementations of ->map_irq() doesn't really provide any useful info. And if something is not working as expected, turning on pci=debug gives you more useful information than the printk calls in ->map_irq(), since the former also tells you which devices _did_ get IRQs successfully assigned. Therefore, delete these printks entirely. Spotted by Russell King. Signed-off-by: Lennert Buytenhek Acked-by: Russell King --- arch/arm/mach-orion5x/dns323-setup.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 05ce6604874..ad810aa5fff 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -53,8 +53,6 @@ static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) if (irq != -1) return irq; - pr_err("%s: requested mapping for unknown device\n", __func__); - return -1; } -- cgit v1.2.3 From 2850a037734eac0af2e6abc4e8be986c3edfd834 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Wed, 28 May 2008 16:17:39 +0200 Subject: [ARM] Orion: avoid setting ->force_phy_addr The mv643xx_eth platform data field ->force_phy_addr only needs to be set if the passed-in ->phy_addr field is zero (to distinguish the case of not having specified a phy address (force_phy_addr = 0) from the case where a phy address of zero needs to be used (force_phy_addr = 1.)) Also, the ->force_phy_addr field will hopefully disappear in a future mv643xx_eth reorganisation. Therefore, this patch deletes the ->force_phy_addr field initialiser from all Orion board code. Signed-off-by: Lennert Buytenhek --- arch/arm/mach-orion5x/dns323-setup.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index ad810aa5fff..64730a045ff 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -80,7 +80,6 @@ subsys_initcall(dns323_pci_init); static struct mv643xx_eth_platform_data dns323_eth_data = { .phy_addr = 8, - .force_phy_addr = 1, }; /**************************************************************************** -- cgit v1.2.3 From 79e90dd5aa95adfdc3117db8a559da3d0195ba58 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Wed, 28 May 2008 16:43:48 +0200 Subject: [ARM] Orion: nuke orion5x_{read,write} Nuke the Orion-specific orion5x_{read,write} wrappers. Signed-off-by: Lennert Buytenhek --- arch/arm/mach-orion5x/dns323-setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-orion5x/dns323-setup.c') diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 64730a045ff..3791ca6f001 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c @@ -269,7 +269,7 @@ static void __init dns323_init(void) orion5x_init(); orion5x_mpp_conf(dns323_mpp_modes); - orion5x_write(MPP_DEV_CTRL, 0); /* DEV_D[31:16] */ + writel(0, MPP_DEV_CTRL); /* DEV_D[31:16] */ /* * Configure peripherals. -- cgit v1.2.3