mediatek: mt7622: prepare legacy rtl8367c driver for Linux 6.12
Do the minimum necessary to get the legacy rtl8367c driver to build with Linux 6.12. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
438ed53577
commit
78db7780d0
5 changed files with 39 additions and 18 deletions
|
@ -734,4 +734,8 @@ extern rtk_uint32 rtk_switch_maxLutAddrNumber_get(void);
|
||||||
*/
|
*/
|
||||||
rtk_uint32 rtk_switch_isValidTrunkGrpId(rtk_uint32 grpId);
|
rtk_uint32 rtk_switch_isValidTrunkGrpId(rtk_uint32 grpId);
|
||||||
|
|
||||||
|
int gsw_debug_proc_init(void);
|
||||||
|
void gsw_debug_proc_exit(void);
|
||||||
|
int rtl8367s_swconfig_init(void (*reset_func)(void));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Realtek Semiconductor Corp.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Unless you and Realtek execute a separate written software license
|
||||||
|
* agreement governing use of this software, this software is licensed
|
||||||
|
* to you under the terms of the GNU General Public License version 2,
|
||||||
|
* available at https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
||||||
|
*
|
||||||
|
* $Revision: 76333 $
|
||||||
|
* $Date: 2017-03-09 09:33:15 +0800 (¶g¥|, 09 ¤T¤ë 2017) $
|
||||||
|
*
|
||||||
|
* Purpose : RTL8367C switch MII access
|
||||||
|
* Feature : MII access functions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _RTL8367C_ASICDRV_MII_MGR_H_
|
||||||
|
#define _RTL8367C_ASICDRV_MII_MGR_H_
|
||||||
|
|
||||||
|
#define u32 unsigned int
|
||||||
|
extern u32 mii_mgr_read(u32 phy_addr, u32 phy_register, u32 *read_data);
|
||||||
|
extern u32 mii_mgr_write(u32 phy_addr, u32 phy_register, u32 write_data);
|
||||||
|
|
||||||
|
#endif /*_RTL8367C_ASICDRV_MII_MGR_H_*/
|
||||||
|
|
|
@ -38,9 +38,7 @@ static init_state_t init_state = INIT_COMPLETED;
|
||||||
static init_state_t init_state = INIT_NOT_COMPLETED;
|
static init_state_t init_state = INIT_NOT_COMPLETED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define AUTO_PROBE (!defined(FORCE_PROBE_RTL8367C) && !defined(FORCE_PROBE_RTL8370B) && !defined(FORCE_PROBE_RTL8364B) && !defined(FORCE_PROBE_RTL8363SC_VB))
|
#if ((!defined(FORCE_PROBE_RTL8367C) && !defined(FORCE_PROBE_RTL8370B) && !defined(FORCE_PROBE_RTL8364B) && !defined(FORCE_PROBE_RTL8363SC_VB)) || defined(FORCE_PROBE_RTL8367C))
|
||||||
|
|
||||||
#if (AUTO_PROBE || defined(FORCE_PROBE_RTL8367C))
|
|
||||||
static rtk_switch_halCtrl_t rtl8367c_hal_Ctrl =
|
static rtk_switch_halCtrl_t rtl8367c_hal_Ctrl =
|
||||||
{
|
{
|
||||||
/* Switch Chip */
|
/* Switch Chip */
|
||||||
|
@ -109,7 +107,7 @@ static rtk_switch_halCtrl_t rtl8367c_hal_Ctrl =
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (AUTO_PROBE || defined(FORCE_PROBE_RTL8370B))
|
#if ((!defined(FORCE_PROBE_RTL8367C) && !defined(FORCE_PROBE_RTL8370B) && !defined(FORCE_PROBE_RTL8364B) && !defined(FORCE_PROBE_RTL8363SC_VB)) || defined(FORCE_PROBE_RTL8370B))
|
||||||
static rtk_switch_halCtrl_t rtl8370b_hal_Ctrl =
|
static rtk_switch_halCtrl_t rtl8370b_hal_Ctrl =
|
||||||
{
|
{
|
||||||
/* Switch Chip */
|
/* Switch Chip */
|
||||||
|
@ -178,7 +176,7 @@ static rtk_switch_halCtrl_t rtl8370b_hal_Ctrl =
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (AUTO_PROBE || defined(FORCE_PROBE_RTL8364B))
|
#if ((!defined(FORCE_PROBE_RTL8367C) && !defined(FORCE_PROBE_RTL8370B) && !defined(FORCE_PROBE_RTL8364B) && !defined(FORCE_PROBE_RTL8363SC_VB)) || defined(FORCE_PROBE_RTL8364B))
|
||||||
static rtk_switch_halCtrl_t rtl8364b_hal_Ctrl =
|
static rtk_switch_halCtrl_t rtl8364b_hal_Ctrl =
|
||||||
{
|
{
|
||||||
/* Switch Chip */
|
/* Switch Chip */
|
||||||
|
@ -247,7 +245,7 @@ static rtk_switch_halCtrl_t rtl8364b_hal_Ctrl =
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (AUTO_PROBE || defined(FORCE_PROBE_RTL8363SC_VB))
|
#if ((!defined(FORCE_PROBE_RTL8367C) && !defined(FORCE_PROBE_RTL8370B) && !defined(FORCE_PROBE_RTL8364B) && !defined(FORCE_PROBE_RTL8363SC_VB)) || defined(FORCE_PROBE_RTL8363SC_VB))
|
||||||
static rtk_switch_halCtrl_t rtl8363sc_vb_hal_Ctrl =
|
static rtk_switch_halCtrl_t rtl8363sc_vb_hal_Ctrl =
|
||||||
{
|
{
|
||||||
/* Switch Chip */
|
/* Switch Chip */
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
#include <rtk_types.h>
|
#include <rtk_types.h>
|
||||||
#include <smi.h>
|
#include <smi.h>
|
||||||
|
#include <rtl8367c_asicdrv_mii_mgr.h>
|
||||||
|
|
||||||
#include "rtk_error.h"
|
#include "rtk_error.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,10 +37,6 @@
|
||||||
#define MDC_MDIO_WRITE(preamableLength, phyID, regID, data)
|
#define MDC_MDIO_WRITE(preamableLength, phyID, regID, data)
|
||||||
#define MDC_MDIO_READ(preamableLength, phyID, regID, pData)
|
#define MDC_MDIO_READ(preamableLength, phyID, regID, pData)
|
||||||
#else
|
#else
|
||||||
#define u32 unsigned int
|
|
||||||
extern u32 mii_mgr_read(u32 phy_addr, u32 phy_register, u32 *read_data);
|
|
||||||
extern u32 mii_mgr_write(u32 phy_addr, u32 phy_register, u32 write_data);
|
|
||||||
|
|
||||||
#define MDC_MDIO_WRITE(preamableLength, phyID, regID, data) mii_mgr_write(phyID, regID, data)
|
#define MDC_MDIO_WRITE(preamableLength, phyID, regID, data) mii_mgr_write(phyID, regID, data)
|
||||||
#define MDC_MDIO_READ(preamableLength, phyID, regID, pData) mii_mgr_read(phyID, regID, pData)
|
#define MDC_MDIO_READ(preamableLength, phyID, regID, pData) mii_mgr_read(phyID, regID, pData)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,12 +19,14 @@
|
||||||
#include <linux/of_mdio.h>
|
#include <linux/of_mdio.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/of_gpio.h>
|
#include <linux/of_gpio.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
|
||||||
#include "./rtl8367c/include/rtk_switch.h"
|
#include "./rtl8367c/include/rtk_switch.h"
|
||||||
#include "./rtl8367c/include/port.h"
|
#include "./rtl8367c/include/port.h"
|
||||||
#include "./rtl8367c/include/vlan.h"
|
#include "./rtl8367c/include/vlan.h"
|
||||||
#include "./rtl8367c/include/rtl8367c_asicdrv_port.h"
|
#include "./rtl8367c/include/rtl8367c_asicdrv_port.h"
|
||||||
|
#include "./rtl8367c/include/rtl8367c_asicdrv_mii_mgr.h"
|
||||||
|
|
||||||
struct rtk_gsw {
|
struct rtk_gsw {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
@ -34,13 +36,6 @@ struct rtk_gsw {
|
||||||
|
|
||||||
static struct rtk_gsw *_gsw;
|
static struct rtk_gsw *_gsw;
|
||||||
|
|
||||||
extern int gsw_debug_proc_init(void);
|
|
||||||
extern void gsw_debug_proc_exit(void);
|
|
||||||
|
|
||||||
#ifdef CONFIG_SWCONFIG
|
|
||||||
extern int rtl8367s_swconfig_init( void (*reset_func)(void) );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*mii_mgr_read/mii_mgr_write is the callback API for rtl8367 driver*/
|
/*mii_mgr_read/mii_mgr_write is the callback API for rtl8367 driver*/
|
||||||
unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
|
unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int phy_register,unsigned int *read_data)
|
||||||
{
|
{
|
||||||
|
@ -204,7 +199,7 @@ static void set_rtl8367s_rgmii(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_gsw(void)
|
static void init_gsw(void)
|
||||||
{
|
{
|
||||||
rtl8367s_hw_init();
|
rtl8367s_hw_init();
|
||||||
set_rtl8367s_sgmii();
|
set_rtl8367s_sgmii();
|
||||||
|
|
Loading…
Reference in a new issue