1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-28 00:04:05 +02:00

rtl8366_smi: move RTL8366S driver into a separate file

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19279 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2010-01-22 17:38:07 +00:00
parent 62717a96cd
commit e47c4f9d9e
16 changed files with 1853 additions and 1769 deletions

View File

@ -16,11 +16,11 @@ config interface wan
option proto dhcp
config switch
option name rtl8366-smi
option name rtl8366s
option reset 1
option enable_vlan 1
config switch_vlan
option device rtl8366-smi
option device rtl8366s
option vlan 0
option ports "0 1 2 3 5"

View File

@ -16,11 +16,11 @@ config interface wan
option proto dhcp
config switch
option name rtl8366-smi
option name rtl8366s
option reset 1
option enable_vlan 1
config switch_vlan
option device rtl8366-smi
option device rtl8366s
option vlan 0
option ports "0 1 2 3 5"

View File

@ -16,11 +16,11 @@ config interface wan
option proto dhcp
config switch
option name rtl8366-smi
option name rtl8366s
option reset 1
option enable_vlan 1
config switch_vlan
option device rtl8366-smi
option device rtl8366s
option vlan 0
option ports "0 1 2 3 5"

View File

@ -185,7 +185,8 @@ CONFIG_PHYLIB=y
# CONFIG_PROBE_INITRD_HEADER is not set
CONFIG_RTL8306_PHY=y
CONFIG_RTL8366_SMI=y
# CONFIG_RTL8366_SMI_DEBUG_FS is not set
CONFIG_RTL8366S_PHY=y
# CONFIG_RTL8366S_PHY_DEBUG_FS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_EXTENDED is not set

View File

@ -190,7 +190,8 @@ CONFIG_PHYLIB=y
# CONFIG_PROBE_INITRD_HEADER is not set
CONFIG_RTL8306_PHY=y
CONFIG_RTL8366_SMI=y
# CONFIG_RTL8366_SMI_DEBUG_FS is not set
CONFIG_RTL8366S_PHY=y
# CONFIG_RTL8366S_PHY_DEBUG_FS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_EXTENDED is not set

View File

@ -193,7 +193,8 @@ CONFIG_PHYLIB=y
# CONFIG_PROBE_INITRD_HEADER is not set
CONFIG_RTL8306_PHY=y
CONFIG_RTL8366_SMI=y
# CONFIG_RTL8366_SMI_DEBUG_FS is not set
CONFIG_RTL8366S_PHY=y
# CONFIG_RTL8366S_PHY_DEBUG_FS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_EXTENDED is not set

View File

@ -14,7 +14,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/delay.h>
#include <linux/rtl8366_smi.h>
#include <linux/rtl8366s.h>
#include <asm/mach-ar71xx/ar71xx.h>
@ -130,16 +130,16 @@ static struct gpio_button dir825b1_gpio_buttons[] __initdata = {
}
};
static struct rtl8366_smi_platform_data dir825b1_rtl8366_smi_data = {
static struct rtl8366s_platform_data dir825b1_rtl8366s_data = {
.gpio_sda = DIR825B1_GPIO_RTL8366_SDA,
.gpio_sck = DIR825B1_GPIO_RTL8366_SCK,
};
static struct platform_device dir825b1_rtl8366_smi_device = {
.name = "rtl8366-smi",
static struct platform_device dir825b1_rtl8366s_device = {
.name = RTL8366S_DRIVER_NAME,
.id = -1,
.dev = {
.platform_data = &dir825b1_rtl8366_smi_data,
.platform_data = &dir825b1_rtl8366s_data,
}
};
@ -155,13 +155,13 @@ static void __init dir825b1_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.mii_bus_dev = &dir825b1_rtl8366_smi_device.dev;
ar71xx_eth0_data.mii_bus_dev = &dir825b1_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
ar71xx_eth1_data.mii_bus_dev = &dir825b1_rtl8366_smi_device.dev;
ar71xx_eth1_data.mii_bus_dev = &dir825b1_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x10;
ar71xx_eth1_pll_data.pll_1000 = 0x11110000;
@ -180,7 +180,7 @@ static void __init dir825b1_setup(void)
ar71xx_add_device_usb();
platform_device_register(&dir825b1_rtl8366_smi_device);
platform_device_register(&dir825b1_rtl8366s_device);
ap94_pci_init((u8 *) KSEG1ADDR(DIR825B1_CAL_LOCATION_0),
(u8 *) KSEG1ADDR(DIR825B1_MAC_LOCATION_0),

View File

@ -13,7 +13,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/delay.h>
#include <linux/rtl8366_smi.h>
#include <linux/rtl8366s.h>
#include <asm/mach-ar71xx/ar71xx.h>
@ -143,16 +143,16 @@ static struct gpio_button wndr3700_gpio_buttons[] __initdata = {
}
};
static struct rtl8366_smi_platform_data wndr3700_rtl8366_smi_data = {
static struct rtl8366s_platform_data wndr3700_rtl8366s_data = {
.gpio_sda = WNDR3700_GPIO_RTL8366_SDA,
.gpio_sck = WNDR3700_GPIO_RTL8366_SCK,
};
static struct platform_device wndr3700_rtl8366_smi_device = {
.name = "rtl8366-smi",
static struct platform_device wndr3700_rtl8366s_device = {
.name = RTL8366S_DRIVER_NAME,
.id = -1,
.dev = {
.platform_data = &wndr3700_rtl8366_smi_data,
.platform_data = &wndr3700_rtl8366s_data,
}
};
@ -163,14 +163,14 @@ static void __init wndr3700_setup(void)
ar71xx_set_mac_base(art);
ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366_smi_device.dev;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth1_pll_data.pll_1000 = 0x11110000;
ar71xx_eth1_data.mii_bus_dev = &wndr3700_rtl8366_smi_device.dev;
ar71xx_eth1_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x10;
@ -188,7 +188,7 @@ static void __init wndr3700_setup(void)
ARRAY_SIZE(wndr3700_gpio_buttons),
wndr3700_gpio_buttons);
platform_device_register(&wndr3700_rtl8366_smi_device);
platform_device_register(&wndr3700_rtl8366s_device);
platform_device_register_simple("wndr3700-led-usb", -1, NULL, 0);
ap94_pci_init(art + WNDR3700_CALDATA0_OFFSET,

View File

@ -12,7 +12,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/nxp_74hc153.h>
#include <linux/rtl8366_smi.h>
#include <linux/rtl8366s.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
@ -212,16 +212,16 @@ static struct platform_device wzrhpg300nh_74hc153_device = {
}
};
static struct rtl8366_smi_platform_data wzrhpg300nh_rtl8366_smi_data = {
static struct rtl8366s_platform_data wzrhpg300nh_rtl8366s_data = {
.gpio_sda = WZRHPG300NH_GPIO_RTL8366_SDA,
.gpio_sck = WZRHPG300NH_GPIO_RTL8366_SCK,
};
static struct platform_device wzrhpg300nh_rtl8366_smi_device = {
.name = "rtl8366-smi",
static struct platform_device wzrhpg300nh_rtl8366s_device = {
.name = RTL8366S_DRIVER_NAME,
.id = -1,
.dev = {
.platform_data = &wzrhpg300nh_rtl8366_smi_data,
.platform_data = &wzrhpg300nh_rtl8366s_data,
}
};
@ -232,14 +232,14 @@ static void __init wzrhpg300nh_setup(void)
ar71xx_set_mac_base(eeprom + WZRHPG300NH_MAC_OFFSET);
ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366_smi_device.dev;
ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth1_pll_data.pll_1000 = 0x1e000100;
ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366_smi_device.dev;
ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x10;
@ -251,7 +251,7 @@ static void __init wzrhpg300nh_setup(void)
platform_device_register(&wzrhpg300nh_74hc153_device);
platform_device_register(&wzrhpg300nh_flash_device);
platform_device_register(&wzrhpg300nh_rtl8366_smi_device);
platform_device_register(&wzrhpg300nh_rtl8366s_device);
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh_leds_gpio),
wzrhpg300nh_leds_gpio);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,26 @@
/*
* Realtek RTL8366 SMI interface driver defines
*
* Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
*
* 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.
*/
#ifndef _RTL8366_SMI_H
#define _RTL8366_SMI_H
struct rtl8366_smi {
struct device *parent;
unsigned int gpio_sda;
unsigned int gpio_sck;
spinlock_t lock;
};
int rtl8366_smi_init(struct rtl8366_smi *smi);
void rtl8366_smi_cleanup(struct rtl8366_smi *smi);
int rtl8366_smi_write_reg(struct rtl8366_smi *smi, u32 addr, u32 data);
int rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data);
#endif /* _RTL8366_SMI_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,19 @@
/*
* Platform data definition for the Realtek RTL8366 ethernet switch driver
* Platform data definition for the Realtek RTL8366S ethernet switch driver
*
* Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
*
* 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.
*/
#ifndef _RTL8366_SMI_H
#define _RTL8366_SMI_H
#ifndef _RTL8366S_H
#define _RTL8366S_H
struct rtl8366_smi_platform_data {
#define RTL8366S_DRIVER_NAME "rtl8366s"
struct rtl8366s_platform_data {
unsigned gpio_sda;
unsigned gpio_sck;
};

View File

@ -1,27 +1,39 @@
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -140,4 +140,14 @@ config MDIO_GPIO
@@ -140,4 +140,25 @@ config MDIO_GPIO
To compile this driver as a module, choose M here: the module
will be called mdio-gpio.
+config RTL8366_SMI
+ tristate "Support for RTL8366 switch via SMI interface"
+ tristate "Driver for the RTL8366 SMI interface"
+ depends on GENERIC_GPIO
+ ---help---
+ This module implements the SMI interface protocol which is used
+ by some RTL8366 ethernet switch devices via the generic GPIO API.
+
+config RTL8366_SMI_DEBUG_FS
+ bool "RTL8366S driver DEBUG_FS support"
+ depends on RTL8366_SMI
+if RTL8366_SMI
+
+config RTL8366S_PHY
+ tristate "Driver for the Realtek RTL8366S switch"
+ select SWCONFIG
+
+config RTL8366S_PHY_DEBUG_FS
+ bool "RTL8366S switch driver DEBUG_FS support"
+ depends on RTL8366S_PHY
+ depends on DEBUG_FS
+ default n
+
+endif # RTL8366_SMI
+
endif # PHYLIB
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_IP175C_PHY) += ip175c.o
@@ -19,6 +19,8 @@ obj-$(CONFIG_IP175C_PHY) += ip175c.o
obj-$(CONFIG_REALTEK_PHY) += realtek.o
obj-$(CONFIG_AR8216_PHY) += ar8216.o
obj-$(CONFIG_RTL8306_PHY) += rtl8306.o
+obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o
+obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o
obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o
obj-$(CONFIG_MICREL) += micrel.o
obj-$(CONFIG_FIXED_PHY) += fixed.o

View File

@ -1,27 +1,39 @@
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -140,4 +140,14 @@ config MDIO_GPIO
@@ -140,4 +140,25 @@ config MDIO_GPIO
To compile this driver as a module, choose M here: the module
will be called mdio-gpio.
+config RTL8366_SMI
+ tristate "Support for RTL8366 switch via SMI interface"
+ tristate "Driver for the RTL8366 SMI interface"
+ depends on GENERIC_GPIO
+ ---help---
+ This module implements the SMI interface protocol which is used
+ by some RTL8366 ethernet switch devices via the generic GPIO API.
+
+config RTL8366_SMI_DEBUG_FS
+ bool "RTL8366S driver DEBUG_FS support"
+ depends on RTL8366_SMI
+if RTL8366_SMI
+
+config RTL8366S_PHY
+ tristate "Driver for the Realtek RTL8366S switch"
+ select SWCONFIG
+
+config RTL8366S_PHY_DEBUG_FS
+ bool "RTL8366S switch driver DEBUG_FS support"
+ depends on RTL8366S_PHY
+ depends on DEBUG_FS
+ default n
+
+endif # RTL8366_SMI
+
endif # PHYLIB
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_IP175C_PHY) += ip175c.o
@@ -19,6 +19,8 @@ obj-$(CONFIG_IP175C_PHY) += ip175c.o
obj-$(CONFIG_REALTEK_PHY) += realtek.o
obj-$(CONFIG_AR8216_PHY) += ar8216.o
obj-$(CONFIG_RTL8306_PHY) += rtl8306.o
+obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o
+obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o
obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o
obj-$(CONFIG_MICREL) += micrel.o
obj-$(CONFIG_FIXED_PHY) += fixed.o

View File

@ -1,27 +1,39 @@
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -146,4 +146,14 @@ config MDIO_GPIO
@@ -146,4 +146,25 @@ config MDIO_GPIO
To compile this driver as a module, choose M here: the module
will be called mdio-gpio.
+config RTL8366_SMI
+ tristate "Support for RTL8366 switch via SMI interface"
+ tristate "Driver for the RTL8366 SMI interface"
+ depends on GENERIC_GPIO
+ ---help---
+ This module implements the SMI interface protocol which is used
+ by some RTL8366 ethernet switch devices via the generic GPIO API.
+
+config RTL8366_SMI_DEBUG_FS
+ bool "RTL8366S driver DEBUG_FS support"
+ depends on RTL8366_SMI
+if RTL8366_SMI
+
+config RTL8366S_PHY
+ tristate "Driver for the Realtek RTL8366S switch"
+ select SWCONFIG
+
+config RTL8366S_PHY_DEBUG_FS
+ bool "RTL8366S switch driver DEBUG_FS support"
+ depends on RTL8366S_PHY
+ depends on DEBUG_FS
+ default n
+
+endif # RTL8366_SMI
+
endif # PHYLIB
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_IP175C_PHY) += ip175c.o
@@ -20,6 +20,8 @@ obj-$(CONFIG_IP175C_PHY) += ip175c.o
obj-$(CONFIG_REALTEK_PHY) += realtek.o
obj-$(CONFIG_AR8216_PHY) += ar8216.o
obj-$(CONFIG_RTL8306_PHY) += rtl8306.o
+obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o
+obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o
obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o
obj-$(CONFIG_MICREL) += micrel.o
obj-$(CONFIG_FIXED_PHY) += fixed.o