Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
mmc2 = &sdio;
};

chosen {
stdout-path = "serial0:1500000n8";
};

leds {
compatible = "gpio-leds";
pinctrl-names = "default";
Expand All @@ -48,6 +44,14 @@
};
};

bt_reg_on_h: bt-reg-on-regulator {
compatible = "regulator-fixed";
regulator-name = "bt_reg_on";
enable-active-high;
gpio = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
regulator-always-on;
};

sdio_pwrseq: sdio-pwrseq {
compatible = "mmc-pwrseq-simple";
pinctrl-0 = <&wifi_enable_h>;
Expand Down Expand Up @@ -129,6 +133,11 @@
};
};

&fiq_debugger{
rockchip,serial-id = <0>;
status = "okay";
};

&cpu0 {
cpu-supply = <&vdd_core>;
};
Expand All @@ -144,6 +153,16 @@
status = "okay";
};

&io_domains {
status = "okay";
vccio0-supply = <&vcc_io>;
vccio1-supply = <&vcc_io>;
vccio2-supply = <&vcc_1v8>;
vccio3-supply = <&vcc_1v8>;
vccio4-supply = <&vcc_1v8>;
vccio5-supply = <&vcc_io>;
};

&gmac {
clock_in_out = "output";
phy-handle = <&rtl8201f>;
Expand Down Expand Up @@ -176,10 +195,6 @@
pinctrl-0 = <&rtc_32k>;

bluetooth {
bt_reg_on: bt-reg-on {
rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
};

bt_wake_host: bt-wake-host {
rockchip,pins = <4 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
};
Expand Down Expand Up @@ -235,21 +250,19 @@
&sdio {
#address-cells = <1>;
#size-cells = <0>;
max-frequency = <150000000>;
bus-width = <4>;
cap-sd-highspeed;
cap-sdio-irq;
keep-power-in-suspend;
max-frequency = <100000000>;
mmc-pwrseq = <&sdio_pwrseq>;
no-mmc;
no-sd;
non-removable;
sd-uhs-sdr50;
vmmc-supply = <&vcc_io>;
vqmmc-supply = <&vcc_1v8>;
status = "okay";

rtl8723ds: wifi@1 {
reg = <1>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "host-wake";
Expand Down Expand Up @@ -283,7 +296,7 @@
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_xfer>;
status = "okay";
status = "disabled";
};

&uart4 {
Expand All @@ -293,10 +306,9 @@
bluetooth {
compatible = "realtek,rtl8723ds-bt";
device-wake-gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
enable-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
host-wake-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&bt_reg_on &bt_wake_host &host_wake_bt>;
pinctrl-0 = <&bt_wake_host &host_wake_bt>;
};
};

Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/rockchip_linux_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,7 @@ CONFIG_RPMSG_ROCKCHIP_MBOX=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_CPU_PX30=y
CONFIG_CPU_RK1808=y
CONFIG_CPU_RK3308=y
CONFIG_CPU_RK3328=y
CONFIG_CPU_RK3399=y
CONFIG_CPU_RK3528=y
Expand Down
64 changes: 59 additions & 5 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@
#define RTL8211F_LCR_ADDR 0x10
#define RTL8211F_EEELCR_ADDR 0x11

#define RTL8201F_PHY_ID 0x001cc816
#define RTL8201F_PHY_ID_MASK 0x001fffff
#define RTL8201F_LED_PAGE 0x07
#define RTL8201F_LEDS_CFG 0x11
#define RTL8201F_LEDS_CFG_MASK GENMASK(7, 0)
#define RTL8201F_LED0_LINK_100 BIT(1)
#define RTL8201F_LED1_ACTIVITY BIT(7)
#define RTL8201F_LEDS_FUNC 0x13
#define RTL8201F_CUSTOMIZED_LED BIT(3)

/* Module parameters */
#define TX_TIMEO 5000
static int watchdog = TX_TIMEO;
Expand Down Expand Up @@ -3679,6 +3689,7 @@ static int stmmac_request_irq_single(struct net_device *dev)
/* Request the Wake IRQ in case of another line
* is used for WoL
*/
priv->wol_irq_disabled = true;
if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) {
ret = request_irq(priv->wol_irq, stmmac_interrupt,
IRQF_SHARED, dev->name, dev);
Expand Down Expand Up @@ -4203,11 +4214,6 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
if (dma_mapping_error(priv->device, des))
goto dma_map_err;

tx_q->tx_skbuff_dma[first_entry].buf = des;
tx_q->tx_skbuff_dma[first_entry].len = skb_headlen(skb);
tx_q->tx_skbuff_dma[first_entry].map_as_page = false;
tx_q->tx_skbuff_dma[first_entry].buf_type = STMMAC_TXBUF_T_SKB;

if (priv->dma_cap.addr64 <= 32) {
first->des0 = cpu_to_le32(des);

Expand All @@ -4226,6 +4232,23 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)

stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0), queue);

/* In case two or more DMA transmit descriptors are allocated for this
* non-paged SKB data, the DMA buffer address should be saved to
* tx_q->tx_skbuff_dma[].buf corresponding to the last descriptor,
* and leave the other tx_q->tx_skbuff_dma[].buf as NULL to guarantee
* that stmmac_tx_clean() does not unmap the entire DMA buffer too early
* since the tail areas of the DMA buffer can be accessed by DMA engine
* sooner or later.
* By saving the DMA buffer address to tx_q->tx_skbuff_dma[].buf
* corresponding to the last descriptor, stmmac_tx_clean() will unmap
* this DMA buffer right after the DMA engine completely finishes the
* full buffer transmission.
*/
tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des;
tx_q->tx_skbuff_dma[tx_q->cur_tx].len = skb_headlen(skb);
tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = false;
tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type = STMMAC_TXBUF_T_SKB;

/* Prepare fragments */
for (i = 0; i < nfrags; i++) {
const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
Expand Down Expand Up @@ -7090,6 +7113,9 @@ static int phy_rtl8211f_led_fixup(struct phy_device *phydev)
{
u32 val, val2;

if (phydev->phy_id == RTL8201F_PHY_ID)
return 0;

/* Switch to Page 0x0d04 */
phy_write(phydev, RTL8211F_PAGE_SELECT, 0x0d04);

Expand All @@ -7115,6 +7141,9 @@ static int phy_rtl8211f_led_fixup(struct phy_device *phydev)

static int phy_rtl8211f_eee_fixup(struct phy_device *phydev)
{
if (phydev->phy_id == RTL8201F_PHY_ID)
return 0;

phy_write(phydev, 31, 0x0000);
phy_write(phydev, 0, 0x8000);
mdelay(20);
Expand All @@ -7129,6 +7158,24 @@ static int phy_rtl8211f_eee_fixup(struct phy_device *phydev)
return 0;
}

static int phy_rtl8201f_led_fixup(struct phy_device *phydev)
{
int ret;

/* LED0 is yellow (100M link); LED1 is green (activity). */
ret = phy_modify_paged(phydev, RTL8201F_LED_PAGE,
RTL8201F_LEDS_CFG, RTL8201F_LEDS_CFG_MASK,
RTL8201F_LED0_LINK_100 |
RTL8201F_LED1_ACTIVITY);
if (ret < 0)
return ret;

return phy_modify_paged(phydev, RTL8201F_LED_PAGE,
RTL8201F_LEDS_FUNC,
RTL8201F_CUSTOMIZED_LED,
RTL8201F_CUSTOMIZED_LED);
}

/**
* stmmac_dvr_probe
* @device: device pointer
Expand Down Expand Up @@ -7425,6 +7472,13 @@ int stmmac_dvr_probe(struct device *device,
dev_warn(priv->device, "Failed to register fixup for PHY RTL8211F disabling EEE.\n");
}

/* Register fixup for PHY RTL8201F */
ret = phy_register_fixup_for_uid(RTL8201F_PHY_ID,
RTL8201F_PHY_ID_MASK,
phy_rtl8201f_led_fixup);
if (ret)
dev_warn(priv->device, "Failed to register fixup for PHY RTL8201F.\n");

return ret;

error_netdev_register:
Expand Down
Loading