Просмотр исходного кода

add experimental support for the Atheros PB44 board

SVN-Revision: 15928
Gabor Juhos 16 лет назад
Родитель
Сommit
7807c1a29f

+ 3 - 0
target/linux/ar71xx/base-files/lib/ar71xx.sh

@@ -25,6 +25,9 @@ ar71xx_board_name() {
 	*PB42)
 		name="pb42"
 		;;
+	*PB44)
+		name="pb44"
+		;;
 	*RB-411)
 		name="rb-411"
 		;;

+ 1 - 0
target/linux/ar71xx/config-2.6.28

@@ -13,6 +13,7 @@ CONFIG_AR71XX_MACH_GENERIC=y
 CONFIG_AR71XX_MACH_MZK_W04NU=y
 CONFIG_AR71XX_MACH_MZK_W300NH=y
 CONFIG_AR71XX_MACH_PB42=y
+CONFIG_AR71XX_MACH_PB44=y
 CONFIG_AR71XX_MACH_RB_4XX=y
 CONFIG_AR71XX_MACH_TEW_632BRP=y
 CONFIG_AR71XX_MACH_TL_WR941ND=y

+ 1 - 0
target/linux/ar71xx/config-2.6.29

@@ -12,6 +12,7 @@ CONFIG_AR71XX_MACH_GENERIC=y
 CONFIG_AR71XX_MACH_MZK_W04NU=y
 CONFIG_AR71XX_MACH_MZK_W300NH=y
 CONFIG_AR71XX_MACH_PB42=y
+CONFIG_AR71XX_MACH_PB44=y
 CONFIG_AR71XX_MACH_RB_4XX=y
 CONFIG_AR71XX_MACH_TEW_632BRP=y
 CONFIG_AR71XX_MACH_TL_WR941ND=y

+ 1 - 0
target/linux/ar71xx/config-2.6.30

@@ -12,6 +12,7 @@ CONFIG_AR71XX_MACH_GENERIC=y
 CONFIG_AR71XX_MACH_MZK_W04NU=y
 CONFIG_AR71XX_MACH_MZK_W300NH=y
 CONFIG_AR71XX_MACH_PB42=y
+CONFIG_AR71XX_MACH_PB44=y
 CONFIG_AR71XX_MACH_RB_4XX=y
 CONFIG_AR71XX_MACH_TEW_632BRP=y
 CONFIG_AR71XX_MACH_TL_WR941ND=y

+ 4 - 0
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig

@@ -18,6 +18,10 @@ config AR71XX_MACH_PB42
 	bool "Atheros PB42 board support"
 	default y
 
+config AR71XX_MACH_PB44
+	bool "Atheros PB44 board support"
+	default y
+
 config AR71XX_MACH_AW_NR580
 	bool "AzureWave AW-NR580 board support"
 	default y

+ 1 - 0
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile

@@ -17,6 +17,7 @@ obj-$(CONFIG_AR71XX_MACH_GENERIC)	+= mach-generic.o
 obj-$(CONFIG_AR71XX_MACH_MZK_W04NU)	+= mach-mzk-w04nu.o
 obj-$(CONFIG_AR71XX_MACH_MZK_W300NH)	+= mach-mzk-w300nh.o
 obj-$(CONFIG_AR71XX_MACH_PB42)		+= mach-pb42.o
+obj-$(CONFIG_AR71XX_MACH_PB44)		+= mach-pb44.o
 obj-$(CONFIG_AR71XX_MACH_RB_4XX)	+= mach-rb-4xx.o
 obj-$(CONFIG_AR71XX_MACH_TEW_632BRP)	+= mach-tew-632brp.o
 obj-$(CONFIG_AR71XX_MACH_TL_WR941ND)	+= mach-tl-wr941nd.o

+ 79 - 0
target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c

@@ -0,0 +1,79 @@
+/*
+ *  Atheros PB44 board support
+ *
+ *  Copyright (C) 2009 Gabor Juhos <[email protected]>
+ *
+ *  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/bitops.h>
+#include <linux/input.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+
+#include <asm/mips_machine.h>
+#include <asm/mach-ar71xx/ar71xx.h>
+#include <asm/mach-ar71xx/pci.h>
+
+#include "devices.h"
+
+static struct spi_board_info pb44_spi_info[] = {
+	{
+		.bus_num	= 0,
+		.chip_select	= 0,
+		.max_speed_hz	= 25000000,
+		.modalias	= "m25p80",
+	}
+};
+
+static struct ar71xx_pci_irq pb44_pci_irqs[] __initdata = {
+	{
+		.slot	= 0,
+		.pin	= 1,
+		.irq	= AR71XX_PCI_IRQ_DEV0,
+	}, {
+		.slot	= 1,
+		.pin	= 1,
+		.irq	= AR71XX_PCI_IRQ_DEV1,
+	}, {
+		.slot	= 2,
+		.pin	= 1,
+		.irq	= AR71XX_PCI_IRQ_DEV2,
+	}
+};
+
+#define PB44_WAN_PHYMASK	BIT(1)
+#define PB44_LAN_PHYMASK	0
+#define PB44_MDIO_PHYMASK	(PB44_LAN_PHYMASK | PB44_WAN_PHYMASK)
+
+static void __init pb44_init(void)
+{
+	ar71xx_add_device_spi(NULL, pb44_spi_info,
+				ARRAY_SIZE(pb44_spi_info));
+
+	ar71xx_add_device_mdio(~PB44_MDIO_PHYMASK);
+
+	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+	ar71xx_eth0_data.phy_mask = PB44_WAN_PHYMASK;
+
+	ar71xx_add_device_eth(0);
+
+	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+	ar71xx_eth1_data.phy_mask = PB44_WAN_PHYMASK;
+	ar71xx_eth1_data.speed = SPEED_1000;
+	ar71xx_eth1_data.duplex = DUPLEX_FULL;
+
+	ar71xx_add_device_eth(1);
+
+	ar71xx_add_device_usb();
+
+	ar71xx_pci_init(ARRAY_SIZE(pb44_pci_irqs), pb44_pci_irqs);
+
+	/* TODO: GPIO LEDs & buttons */
+}
+
+MIPS_MACHINE(AR71XX_MACH_PB44, "Atheros PB44", pb44_init);

+ 3 - 0
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c

@@ -83,6 +83,9 @@ static struct board_rec boards[] __initdata = {
 	}, {
 		.name		= "PB42",
 		.mach_type	= AR71XX_MACH_PB42,
+	}, {
+		.name		= "PB44",
+		.mach_type	= AR71XX_MACH_PB44,
 	}, {
 		.name		= "MZK-W300NH",
 		.mach_type	= AR71XX_MACH_MZK_W300NH,

+ 1 - 0
target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h

@@ -131,6 +131,7 @@ extern unsigned long ar71xx_mach_type;
 #define AR71XX_MACH_UBNT_RSPRO	17	/* Ubiquiti RouterStation Pro */
 #define AR71XX_MACH_AP81	18	/* Atheros AP81 */
 #define AR71XX_MACH_WRT400N	19	/* Linksys WRT400N */
+#define AR71XX_MACH_PB44	20	/* Atheros PB44 */
 
 /*
  * PLL block