Skip to content
Open
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
33 changes: 24 additions & 9 deletions arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
};

chosen {
stdout-path = "serial0:1500000n8";
bootargs = "root=UUID=bbc884d7-bf5a-4713-9301-03dbb8cacab0 earlycon=uart8250,mmio32,0xff0a0000 swiotlb=1 kpti=0 console=ttyFIQ0 rw rootwait coherent_pool=1m";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改动应该会导致启动问题,我们的bootargs都是uboot读取启动配置再传入的

};

leds {
Expand Down Expand Up @@ -129,6 +129,11 @@
};
};

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

&cpu0 {
cpu-supply = <&vdd_core>;
};
Expand All @@ -144,10 +149,22 @@
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>;
phy-supply = <&vcc_io>;
tx_delay = <0x30>;
rx_delay = <0x10>;
status = "okay";

mdio {
Expand Down Expand Up @@ -235,23 +252,21 @@
&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>;
non-removable;
sd-uhs-sdr104;
status = "okay";

rtl8723ds: wifi@1 {
reg = <1>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <RK_PA0 GPIO_ACTIVE_HIGH>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中断不能使用GPIO相关的常量

interrupt-names = "host-wake";
pinctrl-names = "default";
pinctrl-0 = <&wifi_host_wake>;
Expand Down Expand Up @@ -283,7 +298,7 @@
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_xfer>;
status = "okay";
status = "disabled";
};

&uart4 {
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
84 changes: 18 additions & 66 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@
#define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
#define TSO_MAX_BUFF_SIZE (SZ_16K - 1)

#define RTL8211F_PHY_UID 0x001cc800
#define RTL8211F_PHY_UID_MASK 0x001ffc00
#define RTL8211F_PAGE_SELECT 0x1f
#define RTL8211F_LCR_ADDR 0x10
#define RTL8211F_EEELCR_ADDR 0x11

/* Module parameters */
#define TX_TIMEO 5000
static int watchdog = TX_TIMEO;
Expand Down Expand Up @@ -3679,6 +3673,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 +4198,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 +4216,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 @@ -7086,49 +7093,6 @@ void stmmac_fpe_handshake(struct stmmac_priv *priv, bool enable)
}
}

static int phy_rtl8211f_led_fixup(struct phy_device *phydev)
{
u32 val, val2;

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

/* Set LED1(Green) Link 10/100/1000M + Active, and set LED2(Yellow) Link 10/100/1000M */
val = phy_read(phydev, RTL8211F_LCR_ADDR);
val |= (1<<5);
val |= (1<<8);
val |= (1<<10);
val |= (1<<11);
val &= (~(1<<14));
phy_write(phydev, RTL8211F_LCR_ADDR, val);

/* Disable LED2(Yellow) EEE LED function to keep it on when linked */
val2 = phy_read(phydev, RTL8211F_EEELCR_ADDR);
val2 &= (~(1<<3));
phy_write(phydev, RTL8211F_EEELCR_ADDR, val2);

/* Switch back to the PHY's IEEE Standard Registers. Here it is Page 0 */
phy_write(phydev, RTL8211F_PAGE_SELECT, 0);

return 0;
}

static int phy_rtl8211f_eee_fixup(struct phy_device *phydev)
{
phy_write(phydev, 31, 0x0000);
phy_write(phydev, 0, 0x8000);
mdelay(20);
phy_write(phydev, 31, 0x0a4b);
phy_write(phydev, 17, 0x1110);
phy_write(phydev, 31, 0x0000);
phy_write(phydev, 13, 0x0007);
phy_write(phydev, 14, 0x003c);
phy_write(phydev, 13, 0x4007);
phy_write(phydev, 14, 0x0000);

return 0;
}

/**
* stmmac_dvr_probe
* @device: device pointer
Expand Down Expand Up @@ -7413,18 +7377,6 @@ int stmmac_dvr_probe(struct device *device,
*/
pm_runtime_put(device);

/* Register fixup for PHY RTL8211F */
ret = phy_register_fixup_for_uid(RTL8211F_PHY_UID, RTL8211F_PHY_UID_MASK, phy_rtl8211f_led_fixup);
if (ret) {
dev_warn(priv->device, "Failed to register fixup for PHY RTL8211F.\n");
}

/* Register fixup for PHY RTL8211F disabling EEE */
ret = phy_register_fixup_for_uid(RTL8211F_PHY_UID, RTL8211F_PHY_UID_MASK, phy_rtl8211f_eee_fixup);
if (ret) {
dev_warn(priv->device, "Failed to register fixup for PHY RTL8211F disabling EEE.\n");
}

return ret;

error_netdev_register:
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ int stmmac_mdio_idle(struct mii_bus *bus)
reset_gpio = devm_gpiod_get_optional(priv->device,
"snps,reset",
GPIOD_OUT_HIGH);
if (IS_ERR(reset_gpio))
return PTR_ERR(reset_gpio);
if (IS_ERR_OR_NULL(reset_gpio))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所以电路上是没有接reset么?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RadxaYuntian 天哥,明天重新整理下所有提交,stephen 说让我找找linux-6.1-stan-rkr7的提交,最好 cherry-pick

return PTR_ERR_OR_ZERO(reset_gpio);

devm_gpiod_put(priv->device, reset_gpio);
}
Expand Down Expand Up @@ -386,8 +386,8 @@ int stmmac_mdio_reset(struct mii_bus *bus)
reset_gpio = devm_gpiod_get_optional(priv->device,
"snps,reset",
GPIOD_OUT_LOW);
if (IS_ERR(reset_gpio))
return PTR_ERR(reset_gpio);
if (IS_ERR_OR_NULL(reset_gpio))
return PTR_ERR_OR_ZERO(reset_gpio);

device_property_read_u32_array(priv->device,
"snps,reset-delays-us",
Expand Down
Loading