};
};
+ ethmac: ethernet@0xff3f0000 {
+ compatible = "amlogic, gxbb-eth-dwmac";
+ status = "disable";
+ reg = <0x0 0xff3f0000 0x0 0x10000
+ 0x0 0xff634540 0x0 0x8>;
+ interrupts = <0 8 1>;
+ pinctrl-names = "external_eth_pins";
+ pinctrl-0 = <&external_eth_pins>;
+ mc_val_internal_phy = <0x1800>;
+ mc_val_external_phy = <0x1621>;
+ interrupt-names = "macirq";
+ clocks = <&clkc CLKID_ETH_CORE>;
+ clock-names = "ethclk81";
+ internal_phy=<0>;
+ };
+
dwc3: dwc3@ff500000 {
compatible = "synopsys, dwc3";
status = "okay";
};
+ ethmac: ethernet@0xff3f0000 {
+ compatible = "amlogic, gxbb-eth-dwmac";
+ reg = <0x0 0xff3f0000 0x0 0x10000
+ 0x0 0xff634540 0x0 0x8>;
+ interrupts = <0 8 1>;
+ pinctrl-names = "external_eth_pins";
+ pinctrl-0 = <&external_eth_pins>;
+ mc_val_internal_phy = <0x1800>;
+ mc_val_external_phy = <0x1621>;
+ interrupt-names = "macirq";
+ clocks = <&clkc CLKID_ETH_CORE>;
+ clock-names = "ethclk81";
+ internal_phy=<0>;
+ };
+
dwc3: dwc3@ff500000 {
compatible = "synopsys, dwc3";
status = "okay";
};
};
};
-
+ ethmac: ethernet@0xff3f0000 {
+ compatible = "amlogic, gxbb-eth-dwmac";
+ reg = <0x0 0xff3f0000 0x0 0x10000
+ 0x0 0xff634540 0x0 0x8>;
+ interrupts = <0 8 1>;
+ pinctrl-names = "external_eth_pins";
+ pinctrl-0 = <&external_eth_pins>;
+ mc_val_internal_phy = <0x1800>;
+ mc_val_external_phy = <0x1621>;
+ interrupt-names = "macirq";
+ clocks = <&clkc CLKID_ETH_CORE>;
+ clock-names = "ethclk81";
+ internal_phy=<0>;
+ };
dwc3: dwc3@ff500000 {
compatible = "synopsys, dwc3";
status = "okay";
static void meson6_dwmac_fix_mac_speed(void *priv, unsigned int speed)
{
+#ifdef CONFIG_AMLOGIC_ETH_PRIVE
+
+#else
struct meson_dwmac *dwmac = priv;
unsigned int val;
#ifdef CONFIG_AMLOGIC_ETH_PRIVE
}
writel(val, dwmac->reg);
+#endif
}
#ifdef CONFIG_AMLOGIC_ETH_PRIVE
pr_debug("REG0:REG1 = %p :%p\n", PREG_ETH_REG0, PREG_ETH_REG1);
if (!of_property_read_u32(np, "internal_phy", &internal_phy)) {
+ res = NULL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+ if (res) {
addr = devm_ioremap_resource(dev, res);
PREG_ETH_REG2 = addr;
PREG_ETH_REG3 = addr + 4;
PREG_ETH_REG4 = addr + 8;
+ }
if (internal_phy == 1) {
pr_debug("internal phy\n");
/* Get mec mode & ting value set it in cbus2050 */
} else {
writel(mc_val, PREG_ETH_REG0);
}
+ if (res) {
writel(ETH_REG2_REVERSED | INTERNAL_PHY_ID,
PREG_ETH_REG2);
writel(PHY_ENABLE | USE_PHY_IP | CLK_IN_EN |
ETH_REG3_19_RESVERD | CFG_PHY_ADDR |
CFG_MODE | CFG_EN_HIGH |
ETH_REG3_2_RESERVED, PREG_ETH_REG3);
+ }
pin_ctl = devm_pinctrl_get_select
(&pdev->dev, "internal_eth_pins");
} else {
writel(mc_val, PREG_ETH_REG0);
if (!of_property_read_u32(np, "cali_val", &cali_val))
writel(cali_val, PREG_ETH_REG1);
+ if (res) {
writel(ETH_REG2_REVERSED | INTERNAL_PHY_ID,
PREG_ETH_REG2);
writel(CLK_IN_EN | ETH_REG3_19_RESVERD |
CFG_PHY_ADDR | CFG_MODE | CFG_EN_HIGH |
ETH_REG3_2_RESERVED, PREG_ETH_REG3);
+ }
/* pull reset pin for resetting phy */
gdesc = gpiod_get(&pdev->dev, "rst_pin",
GPIOD_FLAGS_BIT_DIR_OUT);