From 081409708114c51958e980c0988c8571d2a34a02 Mon Sep 17 00:00:00 2001 From: blogic Date: Wed, 8 Jun 2011 17:57:55 +0000 Subject: [lantiq] * fixes spi flash for ar9 * adds limited support for netgear dgn3500 (enough for others to start working with) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27137 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/lantiq/image/Makefile | 10 ++ target/linux/lantiq/patches-2.6.39/410-spi2.patch | 11 +- target/linux/lantiq/patches-2.6.39/420-spi3.patch | 26 ++++- .../linux/lantiq/patches-2.6.39/999-dgn3500.patch | 111 +++++++++++++++++++++ target/linux/lantiq/xway/config-default | 3 +- target/linux/lantiq/xway/profiles/003-netgear.mk | 11 ++ 6 files changed, 164 insertions(+), 8 deletions(-) create mode 100644 target/linux/lantiq/patches-2.6.39/999-dgn3500.patch create mode 100644 target/linux/lantiq/xway/profiles/003-netgear.mk (limited to 'target/linux/lantiq') diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index e73ee1936..0e62ce566 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -136,6 +136,14 @@ define Image/Build/Profile/ARV752DPW22 $(call Image/Build/$(1),$(1),ARV752DPW22) endef +define Image/BuildKernel/Profile/DGN3500B + $(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) +endef + +define Image/Build/Profile/DGN3500B + $(call Image/Build/$(1),$(1),DGN3500B) +endef + define Image/BuildKernel/Profile/Generic $(call Image/BuildKernel/Template,EASY4010,$(xway_cmdline)) $(call Image/BuildKernel/Template,EASY50712,$(xway_cmdline)) @@ -149,6 +157,7 @@ define Image/BuildKernel/Profile/Generic $(call Image/BuildKernel/Template,ARV7518PW,$(xway_cmdline)) $(call Image/BuildKernel/Template,ARV752DPW,$(xway_cmdline)) $(call Image/BuildKernel/Template,ARV752DPW22,$(xway_cmdline)) + $(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline)) $(call Image/BuildKernel/Template,NONE) endef @@ -165,6 +174,7 @@ define Image/Build/Profile/Generic $(call Image/Build/$(1),$(1),ARV7518PW) $(call Image/Build/$(1),$(1),ARV752DPW) $(call Image/Build/$(1),$(1),ARV752DPW22) + $(call Image/Build/$(1),$(1),DGN3500B) $(call Image/Build/$(1),$(1),NONE) $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs endef diff --git a/target/linux/lantiq/patches-2.6.39/410-spi2.patch b/target/linux/lantiq/patches-2.6.39/410-spi2.patch index e37790a81..ee07188ed 100644 --- a/target/linux/lantiq/patches-2.6.39/410-spi2.patch +++ b/target/linux/lantiq/patches-2.6.39/410-spi2.patch @@ -10,13 +10,13 @@ Signed-off-by: Daniel Schwierzeck --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -193,6 +193,14 @@ config SPI_IMX +@@ -193,6 +193,14 @@ This enables using the Freescale i.MX SPI controllers in master mode. +config SPI_LANTIQ + tristate "Lantiq SoC SPI controller" -+ depends on SOC_LANTIQ_XWAY ++ depends on SOC_TYPE_XWAY + select SPI_BITBANG + help + This driver supports the Lantiq SoC SPI controller in master @@ -27,7 +27,7 @@ Signed-off-by: Daniel Schwierzeck depends on PARPORT && EXPERIMENTAL --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile -@@ -26,6 +26,7 @@ obj-$(CONFIG_SPI_EP93XX) += ep93xx_spi. +@@ -26,6 +26,7 @@ obj-$(CONFIG_SPI_GPIO) += spi_gpio.o obj-$(CONFIG_SPI_GPIO_OLD) += spi_gpio_old.o obj-$(CONFIG_SPI_IMX) += spi_imx.o @@ -37,7 +37,7 @@ Signed-off-by: Daniel Schwierzeck obj-$(CONFIG_SPI_PXA2XX_PCI) += pxa2xx_spi_pci.o --- /dev/null +++ b/drivers/spi/spi_lantiq.c -@@ -0,0 +1,1063 @@ +@@ -0,0 +1,1062 @@ +/* + * Lantiq SoC SPI controller + * @@ -64,8 +64,7 @@ Signed-off-by: Daniel Schwierzeck +#include +#include + -+#include -+#include ++#include +#include + +#define LTQ_SPI_CLC 0x00 /* Clock control */ diff --git a/target/linux/lantiq/patches-2.6.39/420-spi3.patch b/target/linux/lantiq/patches-2.6.39/420-spi3.patch index f89886fb7..a0e517a7c 100644 --- a/target/linux/lantiq/patches-2.6.39/420-spi3.patch +++ b/target/linux/lantiq/patches-2.6.39/420-spi3.patch @@ -18,7 +18,7 @@ Signed-off-by: Daniel Schwierzeck #include #include -@@ -119,3 +120,28 @@ ltq_register_etop(struct ltq_eth_data *e +@@ -119,3 +120,41 @@ platform_device_register(<q_etop); } } @@ -34,6 +34,17 @@ Signed-off-by: Daniel Schwierzeck + IRQ_RES(spi_err, LTQ_SSC_EIR), +}; + ++static struct resource ltq_spi_resources_ar9[] = { ++ { ++ .start = LTQ_SSC_BASE_ADDR, ++ .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1, ++ .flags = IORESOURCE_MEM, ++ }, ++ IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9), ++ IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9), ++ IRQ_RES(spi_err, LTQ_SSC_EIR), ++}; ++ +static struct platform_device ltq_spi = { + .name = "ltq-spi", + .resource = ltq_spi_resources, @@ -43,7 +54,20 @@ Signed-off-by: Daniel Schwierzeck +void __init ltq_register_spi(struct ltq_spi_platform_data *pdata, + struct spi_board_info const *info, unsigned n) +{ ++ if(ltq_is_ar9()) ++ ltq_spi.resource = ltq_spi_resources_ar9; + spi_register_board_info(info, n); + ltq_spi.dev.platform_data = pdata; + platform_device_register(<q_spi); +} +--- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h ++++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h +@@ -27,6 +27,8 @@ + + #define LTQ_SSC_TIR (INT_NUM_IM0_IRL0 + 15) + #define LTQ_SSC_RIR (INT_NUM_IM0_IRL0 + 14) ++#define LTQ_SSC_TIR_AR9 (INT_NUM_IM0_IRL0 + 14) ++#define LTQ_SSC_RIR_AR9 (INT_NUM_IM0_IRL0 + 15) + #define LTQ_SSC_EIR (INT_NUM_IM0_IRL0 + 16) + + #define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM1_IRL0 + 21) diff --git a/target/linux/lantiq/patches-2.6.39/999-dgn3500.patch b/target/linux/lantiq/patches-2.6.39/999-dgn3500.patch new file mode 100644 index 000000000..aa8db1008 --- /dev/null +++ b/target/linux/lantiq/patches-2.6.39/999-dgn3500.patch @@ -0,0 +1,111 @@ +--- a/arch/mips/lantiq/machtypes.h ++++ b/arch/mips/lantiq/machtypes.h +@@ -32,6 +32,9 @@ + LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */ + LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */ + LANTIQ_MACH_ARV7518PW, /* ASTORIA */ ++ ++ /* Netgear */ ++ LANTIQ_MACH_DGN3500B, /* Netgear DGN3500 */ + }; + + #endif +--- a/arch/mips/lantiq/xway/Kconfig ++++ b/arch/mips/lantiq/xway/Kconfig +@@ -10,6 +10,10 @@ + bool "ARV45XX" + default y + ++config LANTIQ_MACH_NETGEAR ++ bool "Netgear" ++ default y ++ + endmenu + + endif +--- a/arch/mips/lantiq/xway/Makefile ++++ b/arch/mips/lantiq/xway/Makefile +@@ -6,4 +6,5 @@ + obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o + obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o + obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o ++obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o + obj-y += dev-dwc_otg.o +--- a/arch/mips/lantiq/xway/devices.h ++++ b/arch/mips/lantiq/xway/devices.h +@@ -12,6 +12,7 @@ + #include "../devices.h" + #include + #include ++#include + + extern void ltq_register_gpio(void); + extern void ltq_register_gpio_stp(void); +@@ -20,5 +21,7 @@ + extern void ltq_register_gpio_ebu(unsigned int value); + extern void ltq_register_madwifi_eep(void); + extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt); ++extern void ltq_register_spi(struct ltq_spi_platform_data *pdata, ++ struct spi_board_info const *info, unsigned n); + + #endif +--- /dev/null ++++ b/arch/mips/lantiq/xway/mach-netgear.c +@@ -0,0 +1,57 @@ ++/* ++ * 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. ++ * ++ * Copyright (C) 2010 John Crispin ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "../machtypes.h" ++#include "devices.h" ++ ++static struct ltq_pci_data ltq_pci_data = { ++ .clock = PCI_CLOCK_INT, ++ .gpio = PCI_GNT1 | PCI_REQ1, ++ .irq = { ++ [14] = INT_NUM_IM0_IRL0 + 22, ++ }, ++}; ++ ++static struct ltq_eth_data ltq_eth_data = { ++ .mii_mode = PHY_INTERFACE_MODE_MII, ++}; ++ ++struct spi_board_info spi_info = { ++ .bus_num = 0, ++ .chip_select = 3, ++ .max_speed_hz = 25000000, ++ .modalias = "mx25l12805d", ++}; ++ ++struct ltq_spi_platform_data ltq_spi_data = { ++ .num_chipselect = 4, ++}; ++ ++static void __init dgn3500_init(void) ++{ ++ ltq_register_pci(<q_pci_data); ++ ltq_register_etop(<q_eth_data); ++ ltq_register_spi(<q_spi_data, &spi_info, 1); ++} ++ ++MIPS_MACHINE(LANTIQ_MACH_DGN3500B, ++ "DGN3500B", ++ "Netgear DGN3500B", ++ dgn3500_init); diff --git a/target/linux/lantiq/xway/config-default b/target/linux/lantiq/xway/config-default index dd59fa68d..5ef2fb346 100644 --- a/target/linux/lantiq/xway/config-default +++ b/target/linux/lantiq/xway/config-default @@ -26,9 +26,9 @@ CONFIG_INPUT_POLLDEV=y CONFIG_LANTIQ_ETOP=y CONFIG_LANTIQ_MACH_ARV45XX=y CONFIG_LANTIQ_MACH_EASY50712=y +CONFIG_LANTIQ_MACH_NETGEAR=y CONFIG_MACH_NO_WESTBRIDGE=y # CONFIG_MINIX_FS_NATIVE_ENDIAN is not set -# CONFIG_MTD_LATCH_ADDR is not set CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_PCI=y @@ -44,6 +44,7 @@ CONFIG_SOC_XWAY=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y # CONFIG_SPI_GPIO is not set +CONFIG_SPI_LANTIQ=y CONFIG_SPI_MASTER=y CONFIG_USB_SUPPORT=y CONFIG_XZ_DEC=y diff --git a/target/linux/lantiq/xway/profiles/003-netgear.mk b/target/linux/lantiq/xway/profiles/003-netgear.mk new file mode 100644 index 000000000..51a98bb2d --- /dev/null +++ b/target/linux/lantiq/xway/profiles/003-netgear.mk @@ -0,0 +1,11 @@ +define Profile/DGN3500B + NAME:=DGN3500B + PACKAGES:= kmod-usb-core kmod-usb-dwc-otg kmod-leds-gpio +endef + +define Profile/DGN3500B/Description + Netgear DGN3500B +endef + +$(eval $(call Profile,DGN3500B)) + -- cgit v1.2.3