initial full board support for the Planex MZKNAS0X-SG and other
clones (Mvixbox wdn-2000, Edimax NS-250X).
These products are Cortina CS/SL3516 chipset based NAS devices and did not
have their SATA/PATA, RTC and PWC patches (only Flash+USB+Gigabit til now).
Patch 1/2: kernel makefile/kconfig diffs and second gigabit phy
Patch 2/2: gemini new files: BOARD, PATA, RTC, PWC drivers
Signed-off-by: Frederic Pecourt <opengemini at free.fr>
Index: target/linux/gemini/patches/210-mzknas_board_support.patch
===================================================================
--- target/linux/gemini/patches/210-mzknas_board_support.patch (révision 0)
+++ target/linux/gemini/patches/210-mzknas_board_support.patch (révision 0)
@@ -0,0 +1,290 @@
+--- a/arch/arm/mach-gemini/Kconfig
++++ b/arch/arm/mach-gemini/Kconfig
+@@ -30,6 +30,13 @@ config MACH_WBD222
+ Say Y here if you intend to run this kernel on a
+ Wiliboard WBD-222.
+
++config MACH_MZKNAS
++ bool "Planex MZK NAS"
++ select GEMINI_MEM_SWAP
++ help
++ Say Y here if you intend to run this kernel on a
++ Planex MZK NAS.
++
+ endmenu
+
+ config GEMINI_MEM_SWAP
+--- a/arch/arm/mach-gemini/Makefile
++++ b/arch/arm/mach-gemini/Makefile
+@@ -13,3 +15,4 @@ obj-$(CONFIG_MACH_NAS4220B) += board-nas
+ obj-$(CONFIG_MACH_RUT100) += board-rut1xx.o
+ obj-$(CONFIG_MACH_WBD111) += board-wbd111.o
+ obj-$(CONFIG_MACH_WBD222) += board-wbd222.o
++obj-$(CONFIG_MACH_MZKNAS) += board-mzknas.o
+--- a/arch/arm/mach-gemini/common.h
++++ b/arch/arm/mach-gemini/common.h
+@@ -26,6 +26,9 @@ extern int platform_register_ethernet(st
+ extern int platform_register_pflash(unsigned int size,
+ struct mtd_partition *parts,
+ unsigned int nr_parts);
++extern int platform_register_pata(unsigned int i);
++extern int platform_register_pwc(void);
++extern int platform_register_rtc(void);
+ extern int platform_register_usb(unsigned int i);
+ extern int platform_register_watchdog(void);
+
+--- a/arch/arm/mach-gemini/devices.c
++++ b/arch/arm/mach-gemini/devices.c
+@@ -220,3 +220,130 @@ int platform_register_watchdog(void)
+ {
+ return platform_device_register(&wdt_device);
+ }
++
++/*
++* RTC
++*/
++static struct resource gemini_rtc_resources[] = {
++ [0] = {
++ .start = GEMINI_RTC_BASE,
++ .end = GEMINI_RTC_BASE + 0x24,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = IRQ_RTC,
++ .end = IRQ_RTC,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device gemini_rtc_device = {
++ .name = "rtc-gemini",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(gemini_rtc_resources),
++ .resource = gemini_rtc_resources,
++};
++
++int __init platform_register_rtc(void)
++{
++ return platform_device_register(&gemini_rtc_device);
++}
++
++/*
++* PWC
++*/
++
++static struct resource gemini_pwc_resources[] = {
++ [0] = {
++ .start = GEMINI_POWER_CTRL_BASE,
++ .end = GEMINI_POWER_CTRL_BASE + 0x0C,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = IRQ_PWR,
++ .end = IRQ_PWR,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device gemini_pwc_device = {
++ .name = "gemini_pwc",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(gemini_pwc_resources),
++ .resource = gemini_pwc_resources,
++};
++
++int __init platform_register_pwc(void)
++{
++ return platform_device_register(&gemini_pwc_device);
++}
++
++
++/*
++* PATA
++*/
++
++static u64 gemini_pata_dmamask0 = 0xffffffffUL;
++static u64 gemini_pata_dmamask1 = 0xffffffffUL;
++
++static struct resource gemini_pata_resources0[] = {
++ [0] = {
++ .start = GEMINI_IDE0_BASE,
++ .end = GEMINI_IDE0_BASE + 0x40,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = IRQ_IDE0,
++ .end = IRQ_IDE0,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct resource gemini_pata_resources1[] = {
++ [0] = {
++ .start = GEMINI_IDE1_BASE,
++ .end = GEMINI_IDE1_BASE + 0x40,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = IRQ_IDE1,
++ .end = IRQ_IDE1,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device gemini_pata_devices[] = {
++ {
++ .name = "pata_gemini",
++ .id = 0,
++ .dev = {
++ .dma_mask = &gemini_pata_dmamask0,
++ .coherent_dma_mask = 0xffffffff,
++ },
++ .num_resources = ARRAY_SIZE(gemini_pata_resources0),
++ .resource = gemini_pata_resources0,
++ },
++ {
++ .name = "pata_gemini",
++ .id = 1,
++ .dev = {
++ .dma_mask = &gemini_pata_dmamask1,
++ .coherent_dma_mask = 0xffffffff,
++ },
++ .num_resources = ARRAY_SIZE(gemini_pata_resources1),
++ .resource = gemini_pata_resources1,
++ },
++};
++
++int __init platform_register_pata(unsigned int i)
++{
++ switch (i) {
++ case 0:
++ return platform_device_register(&gemini_pata_devices[0]);
++ case 1:
++ return platform_device_register(&gemini_pata_devices[1]);
++ default:
++ return -EINVAL;
++ }
++}
++
+--- a/arch/arm/mach-gemini/mm.c
++++ b/arch/arm/mach-gemini/mm.c
+@@ -34,6 +34,11 @@ static struct map_desc gemini_io_desc[]
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
++ .virtual = IO_ADDRESS(GEMINI_SATA_BASE),
++ .pfn = __phys_to_pfn(GEMINI_SATA_BASE),
++ .length = SZ_512K,
++ .type = MT_DEVICE,
++ }, {
+ .virtual = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
+ .pfn = __phys_to_pfn(GEMINI_INTERRUPT_BASE),
+ .length = SZ_512K,
+--- a/drivers/ata/Kconfig
++++ b/drivers/ata/Kconfig
+@@ -364,6 +364,16 @@ config ATA_GENERIC
+
+ If unsure, say N.
+
++config PATA_GEMINI
++ tristate "Gemini PATA support (Experimental)"
++ depends on EXPERIMENTAL
++ help
++ This option enables support for the Gemini PATA-Controller.
++ Note that the Gemini SoC has no native SATA-Controller but an
++ onboard PATA-SATA bridge.
++
++ If unsure, say N.
++
+ config PATA_HPT366
+ tristate "HPT 366/368 PATA support"
+ depends on PCI
+--- a/drivers/ata/Makefile
++++ b/drivers/ata/Makefile
+@@ -33,6 +33,7 @@ obj-$(CONFIG_PATA_CS5535) += pata_cs5535
+ obj-$(CONFIG_PATA_CS5536) += pata_cs5536.o
+ obj-$(CONFIG_PATA_CYPRESS) += pata_cypress.o
+ obj-$(CONFIG_PATA_EFAR) += pata_efar.o
++obj-$(CONFIG_PATA_GEMINI) += pata_gemini.o
+ obj-$(CONFIG_PATA_HPT366) += pata_hpt366.o
+ obj-$(CONFIG_PATA_HPT37X) += pata_hpt37x.o
+ obj-$(CONFIG_PATA_HPT3X2N) += pata_hpt3x2n.o
+--- a/drivers/misc/Kconfig
++++ b/drivers/misc/Kconfig
+@@ -55,6 +55,17 @@ config ATMEL_TCB_CLKSRC_BLOCK
+ TC can be used for other purposes, such as PWM generation and
+ interval timing.
+
++config GEMINI_POWER_CTRL
++ tristate "Gemini Power Control"
++ depends on ARCH_GEMINI
++ help
++ Say Y here if you want to build a driver for the Gemini Power Control
++ device. You propably want this, as it's needed to switch off devices
++ based on the Gemini Platform with the powerbutton.
++
++ If you choose to build this as module, it's name will be gemini_pwc.
++ If unsure, say Y here.
++
+ config IBM_ASM
+ tristate "Device driver for IBM RSA service processor"
+ depends on X86 && PCI && INPUT && EXPERIMENTAL
+--- a/drivers/misc/Makefile
++++ b/drivers/misc/Makefile
+@@ -7,6 +7,7 @@ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/
+ obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o
+ obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o
+ obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o
++obj-$(CONFIG_GEMINI_POWER_CTRL) += gemini_pwc.o
+ obj-$(CONFIG_ICS932S401) += ics932s401.o
+ obj-$(CONFIG_LKDTM) += lkdtm.o
+ obj-$(CONFIG_TIFM_CORE) += tifm_core.o
+--- a/drivers/net/gemini_negmac/gm_gmac.c
++++ b/drivers/net/gemini_negmac/gm_gmac.c
+@@ -372,7 +372,8 @@ static void toe_gmac_init_chip(struct ne
+ status.bits.mii_rmii = GMAC_PHY_GMII;
+ break;
+ case PHY_INTERFACE_MODE_RGMII:
+- status.bits.mii_rmii = GMAC_PHY_RGMII_100_10;
++ status.bits.mii_rmii = (gmac->port_id==1) ? GMAC_PHY_RGMII_1000
: GMAC_PHY_RGMII_100_10;
++ //(gmac->phydev->speed==1000)
+ break;
+ default:
+ dev_err(&dev->dev, "Unsupported MII interface\n");
+@@ -1247,6 +1248,8 @@ static int __init gmac_init_eth(struct p
+ gmac->phydev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause;
+ gmac->phydev->advertising = gmac->phydev->supported;
+
++ phy_write(gmac->phydev,0x18 , 0x2740); // due to overbrightness, have
leds blink upon activity only
++
+ return 0;
+ }
+
+--- a/drivers/rtc/Kconfig
++++ b/drivers/rtc/Kconfig
+@@ -739,6 +739,15 @@ config RTC_DRV_BFIN
+ This driver can also be built as a module. If so, the module
+ will be called rtc-bfin.
+
++config RTC_DRV_GEMINI
++ tristate "Gemini SoC RTC"
++ help
++ If you say Y here you will get support for the
++ RTC found on Gemini SoC's.
++
++ This driver can also be built as a module. If so, the module
++ will be called rtc-gemini.
++
+ config RTC_DRV_RS5C313
+ tristate "Ricoh RS5C313"
+ depends on SH_LANDISK
+--- a/drivers/rtc/Makefile
++++ b/drivers/rtc/Makefile
+@@ -42,6 +42,7 @@ obj-$(CONFIG_RTC_DRV_DS3234) += rtc-ds32
+ obj-$(CONFIG_RTC_DRV_EFI) += rtc-efi.o
+ obj-$(CONFIG_RTC_DRV_EP93XX) += rtc-ep93xx.o
+ obj-$(CONFIG_RTC_DRV_FM3130) += rtc-fm3130.o
++obj-$(CONFIG_RTC_DRV_GEMINI) += rtc-gemini.o
+ obj-$(CONFIG_RTC_DRV_GENERIC) += rtc-generic.o
+ obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o
+ obj-$(CONFIG_RTC_DRV_M41T80) += rtc-m41t80.o
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel