1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 07:00:37 +02:00

[lantiq] code style cleanup of the mach files

Signed-off-by: Luka Perkov <openwrt@lukaperkov.net>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31735 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
blogic 2012-05-15 09:38:05 +00:00
parent 993c2e232f
commit 6a54667829
12 changed files with 116 additions and 109 deletions

View File

@ -133,38 +133,6 @@ static struct physmap_flash_data arv_flash_data = {
.parts = arv_partitions, .parts = arv_partitions,
}; };
static void arv_load_nor(unsigned int max)
{
#define UBOOT_MAGIC 0x27051956
int i;
int sector = -1;
if (ltq_brn_boot) {
if (max == 0x800000)
ltq_register_nor(&arv75xx_brnboot_flash_data);
else
ltq_register_nor(&arv45xx_brnboot_flash_data);
return;
}
for (i = 1; i < 4 && sector < 0; i++) {
unsigned int uboot_magic;
memcpy_fromio(&uboot_magic, (void *)KSEG1ADDR(LTQ_FLASH_START) + (i * 0x10000), 4);
if (uboot_magic == UBOOT_MAGIC)
sector = i;
}
if (sector < 0)
return;
arv_partitions[0].size = arv_partitions[1].offset = (sector - 1) * 0x10000;
arv_partitions[2].offset = arv_partitions[0].size + 0x10000;
arv_partitions[2].size = max - arv_partitions[2].offset - 0x10000;
arv_partitions[3].offset = max - 0x10000;
ltq_register_nor(&arv_flash_data);
}
static struct ltq_pci_data ltq_pci_data = { static struct ltq_pci_data ltq_pci_data = {
.clock = PCI_CLOCK_EXT, .clock = PCI_CLOCK_EXT,
.gpio = PCI_GNT1 | PCI_REQ1, .gpio = PCI_GNT1 | PCI_REQ1,
@ -312,7 +280,8 @@ arv4525pw_gpio_leds[] __initdata = {
#define ARV4525PW_PHYRESET 13 #define ARV4525PW_PHYRESET 13
#define ARV4525PW_RELAY 31 #define ARV4525PW_RELAY 31
static struct gpio arv4525pw_gpios[] __initdata = { static struct gpio
arv4525pw_gpios[] __initdata = {
{ ARV4525PW_PHYRESET, GPIOF_OUT_INIT_HIGH, "phyreset" }, { ARV4525PW_PHYRESET, GPIOF_OUT_INIT_HIGH, "phyreset" },
{ ARV4525PW_RELAY, GPIOF_OUT_INIT_HIGH, "relay" }, { ARV4525PW_RELAY, GPIOF_OUT_INIT_HIGH, "relay" },
}; };
@ -416,7 +385,40 @@ arv7525pw_gpio_keys[] __initdata = {
}, },
}; };
static void static void __init
arv_load_nor(unsigned int max)
{
#define UBOOT_MAGIC 0x27051956
int i;
int sector = -1;
if (ltq_brn_boot) {
if (max == 0x800000)
ltq_register_nor(&arv75xx_brnboot_flash_data);
else
ltq_register_nor(&arv45xx_brnboot_flash_data);
return;
}
for (i = 1; i < 4 && sector < 0; i++) {
unsigned int uboot_magic;
memcpy_fromio(&uboot_magic, (void *)KSEG1ADDR(LTQ_FLASH_START) + (i * 0x10000), 4);
if (uboot_magic == UBOOT_MAGIC)
sector = i;
}
if (sector < 0)
return;
arv_partitions[0].size = arv_partitions[1].offset = (sector - 1) * 0x10000;
arv_partitions[2].offset = arv_partitions[0].size + 0x10000;
arv_partitions[2].size = max - arv_partitions[2].offset - 0x10000;
arv_partitions[3].offset = max - 0x10000;
ltq_register_nor(&arv_flash_data);
}
static void __init
arv_register_ethernet(unsigned int mac_addr) arv_register_ethernet(unsigned int mac_addr)
{ {
memcpy_fromio(&ltq_eth_data.mac.sa_data, memcpy_fromio(&ltq_eth_data.mac.sa_data,
@ -428,7 +430,7 @@ static u16 arv_ath5k_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
static u16 arv_ath9k_eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; static u16 arv_ath9k_eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
static u8 arv_athxk_eeprom_mac[6]; static u8 arv_athxk_eeprom_mac[6];
void __init static void __init
arv_register_ath5k(unsigned int ath_addr, unsigned int mac_addr) arv_register_ath5k(unsigned int ath_addr, unsigned int mac_addr)
{ {
int i; int i;
@ -452,7 +454,7 @@ arv_register_ath5k(unsigned int ath_addr, unsigned int mac_addr)
} }
} }
void __init static void __init
arv_register_ath9k(unsigned int ath_addr, unsigned int mac_addr) arv_register_ath9k(unsigned int ath_addr, unsigned int mac_addr)
{ {
int i; int i;

View File

@ -45,7 +45,8 @@ static struct ltq_eth_data ltq_eth_data = {
.mii_mode = -1, /* use EPHY */ .mii_mode = -1, /* use EPHY */
}; };
static void __init easy50601_init(void) static void __init
easy50601_init(void)
{ {
ltq_register_nor(&easy50601_flash_data); ltq_register_nor(&easy50601_flash_data);
ltq_register_etop(&ltq_eth_data); ltq_register_etop(&ltq_eth_data);

View File

@ -55,7 +55,8 @@ static struct ltq_eth_data ltq_eth_data = {
.mii_mode = PHY_INTERFACE_MODE_MII, .mii_mode = PHY_INTERFACE_MODE_MII,
}; };
static void __init easy50712_init(void) static void __init
easy50712_init(void)
{ {
ltq_register_gpio_stp(); ltq_register_gpio_stp();
ltq_register_nor(&easy50712_flash_data); ltq_register_nor(&easy50712_flash_data);

View File

@ -97,7 +97,8 @@ static struct ltq_eth_data ltq_eth_data = {
static int usb_pins[2] = { 50, 51 }; static int usb_pins[2] = { 50, 51 };
static void __init fritz7320_init(void) static void __init
fritz7320_init(void)
{ {
ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
ARRAY_SIZE(fritz7320_gpio_keys), fritz7320_gpio_keys); ARRAY_SIZE(fritz7320_gpio_keys), fritz7320_gpio_keys);

View File

@ -145,7 +145,8 @@ spi_gpio_init(void)
platform_device_register(&spi_gpio_device); platform_device_register(&spi_gpio_device);
} }
static void __init fritz3370_init(void) static void __init
fritz3370_init(void)
{ {
spi_gpio_init(); spi_gpio_init();
platform_device_register_simple("pcie-xway", 0, NULL, 0); platform_device_register_simple("pcie-xway", 0, NULL, 0);

View File

@ -17,7 +17,6 @@
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/ath5k_platform.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/io.h> #include <linux/io.h>
@ -40,7 +39,8 @@
static u8 ltq_ethaddr[6] = { 0 }; static u8 ltq_ethaddr[6] = { 0 };
static int __init setup_ethaddr(char *str) static int __init
setup_ethaddr(char *str)
{ {
if (!mac_pton(str, ltq_ethaddr)) if (!mac_pton(str, ltq_ethaddr))
memset(ltq_ethaddr, 0, 6); memset(ltq_ethaddr, 0, 6);
@ -55,9 +55,10 @@ enum {
SX762, SX762,
SX763, SX763,
}; };
static u8 board = SX763; static u8 board __initdata = SX763;
static int __init setup_board(char *str) static int __init
setup_board(char *str)
{ {
if (!strcmp(str, "sx761")) if (!strcmp(str, "sx761"))
board = SX761; board = SX761;
@ -137,7 +138,8 @@ static struct ltq_eth_data ltq_eth_data = {
.mii_mode = PHY_INTERFACE_MODE_MII, .mii_mode = PHY_INTERFACE_MODE_MII,
}; };
static void __init gigasx76x_init(void) static void __init
gigasx76x_init(void)
{ {
#define GIGASX76X_USB 29 #define GIGASX76X_USB 29

View File

@ -11,6 +11,8 @@
#ifndef _MACH_GIGASX76X_H__ #ifndef _MACH_GIGASX76X_H__
#define _MACH_GIGASX76X_H__ #define _MACH_GIGASX76X_H__
#include <linux/ath5k_platform.h>
static u16 sx763_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS] = static u16 sx763_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS] =
{ {
0x0013,0x168c,0x0200,0x0001,0x0000,0x5001,0x0000,0x2051,0x2051,0x1c0a,0x0100, 0x0013,0x168c,0x0200,0x0001,0x0000,0x5001,0x0000,0x2051,0x2051,0x1c0a,0x0100,

View File

@ -13,11 +13,10 @@
---help--- ---help---
--- a/drivers/mtd/mtdpart.c --- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c
@@ -867,6 +867,169 @@ static int refresh_rootfs_split(struct m @@ -867,6 +867,168 @@ static int refresh_rootfs_split(struct m
} }
#endif /* CONFIG_MTD_ROOTFS_SPLIT */ #endif /* CONFIG_MTD_ROOTFS_SPLIT */
+
+#ifdef CONFIG_MTD_UIMAGE_SPLIT +#ifdef CONFIG_MTD_UIMAGE_SPLIT
+static unsigned long find_uimage_size(struct mtd_info *mtd, +static unsigned long find_uimage_size(struct mtd_info *mtd,
+ unsigned long offset) + unsigned long offset)
@ -183,7 +182,7 @@
/* /*
* This function, given a master MTD object and a partition table, creates * This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to * and registers slave MTD objects which are bound to the master according to
@@ -883,7 +1046,7 @@ int add_mtd_partitions(struct mtd_info * @@ -883,7 +1045,7 @@ int add_mtd_partitions(struct mtd_info *
struct mtd_part *slave; struct mtd_part *slave;
uint64_t cur_offset = 0; uint64_t cur_offset = 0;
int i; int i;
@ -192,7 +191,7 @@
int ret; int ret;
#endif #endif
@@ -900,6 +1063,17 @@ int add_mtd_partitions(struct mtd_info * @@ -900,6 +1062,15 @@ int add_mtd_partitions(struct mtd_info *
add_mtd_device(&slave->mtd); add_mtd_device(&slave->mtd);
@ -200,10 +199,8 @@
+ if (!strcmp(parts[i].name, "linux")) { + if (!strcmp(parts[i].name, "linux")) {
+ ret = split_uimage(master, &parts[i]); + ret = split_uimage(master, &parts[i]);
+ +
+ if (ret) { + if (ret)
+ printk(KERN_WARNING + printk(KERN_WARNING "Can't split linux partition\n");
+ "Can't split linux partition\n");
+ }
+ } + }
+#endif +#endif
+ +