kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi | ●●●●● patch | view | raw | blame | history | |
kernel/drivers/misc/eeprom/at24.c | ●●●●● patch | view | raw | blame | history | |
kernel/drivers/net/ethernet/realtek/r8169.c | ●●●●● patch | view | raw | blame | history | |
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | ●●●●● patch | view | raw | blame | history |
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi
.. .. @@ -146,6 +146,11 @@ 146 146 gpio_function = <0>; 147 147 }; 148 148 149 + m2_wifi_pwr {150 + gpio_num = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;//WIFI_PWREN_GPIO3_C6_1V8151 + gpio_function = <0>;152 + };153 +149 154 150 155 #if 0 151 156 do1 { .. .. @@ -388,7 +393,9 @@ 388 393 rx_delay = <0x2f>; 389 394 390 395 phy-handle = <&rgmii_phy0>; 391 - status = "disabled";396 +397 + status = "okay";398 +392 399 }; 393 400 394 401 &gmac1 { .. .. @@ -533,7 +540,7 @@ 533 540 }; 534 541 535 542 &pcie30phy { 536 - status = "disabled";543 + status = "okay";537 544 }; 538 545 539 546 &pcie2x1 { .. .. @@ -543,7 +550,14 @@ 543 550 }; 544 551 545 552 &pcie3x2 { 546 - reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;553 + reset-gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;554 + vpcie3v3-supply = <&vcc3v3_pcie>;555 + status = "disabled";556 +};557 +558 +&pcie3x1 {559 + rockchip,bifurcation;560 + reset-gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;547 561 vpcie3v3-supply = <&vcc3v3_pcie>; 548 562 status = "okay"; 549 563 }; kernel/drivers/misc/eeprom/at24.c
.. .. @@ -564,6 +564,33 @@ 564 564 } 565 565 EXPORT_SYMBOL(at24_mac1_read); 566 566 567 +ssize_t at24_mac2_read(unsigned char* mac)568 +{569 + char buf[20];570 + char buf_tmp[12];571 + ssize_t ret;572 + if (at24_private == NULL)573 + {574 + printk("zcl: at24_mac_read at24_private==null error");575 + return 0;576 + }577 + memset(buf, 0x00, 20);578 + memset(buf_tmp, 0x00, 12);579 + ret = at24_read_private(at24_private, buf, 0x20, 6);580 + if (ret > 0)581 + {582 + *mac = buf[0];583 + *(mac + 1) = buf[1];584 + *(mac + 2) = buf[2];585 + *(mac + 3) = buf[3];586 + *(mac + 4) = buf[4];587 + *(mac + 5) = buf[5];588 + }589 + printk("at24_mac2_read ...............\n");590 + return ret;591 +}592 +EXPORT_SYMBOL(at24_mac2_read);593 +567 594 static int at24_write(void *priv, unsigned int off, void *val, size_t count) 568 595 { 569 596 struct at24_data *at24; kernel/drivers/net/ethernet/realtek/r8169.c
.. .. @@ -7439,7 +7439,7 @@ 7439 7439 clk_disable_unprepare(data); 7440 7440 } 7441 7441 7442 -extern ssize_t at24_mac1_read(unsigned char* mac);7442 +extern ssize_t at24_mac2_read(unsigned char* mac);7443 7443 static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 7444 7444 { 7445 7445 const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data; .. .. @@ -7602,7 +7602,7 @@ 7602 7602 // for (i = 0; i < ETH_ALEN; i++) 7603 7603 // dev->dev_addr[i] = RTL_R8(tp, MAC0 + i); 7604 7604 memset(mac, 0x00, 6); 7605 - at24_mac1_read(mac);7605 + at24_mac2_read(mac);7606 7606 7607 7607 if ((mac[0] == 0x68) && (mac[1] == 0xed)) 7608 7608 { kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
.. .. @@ -2349,12 +2349,14 @@ 2349 2349 2350 2350 static unsigned char macaddr[6]; 2351 2351 extern ssize_t at24_mac_read(unsigned char* addr); 2352 +extern ssize_t at24_mac1_read(unsigned char* addr);2352 2353 void rk_get_eth_addr(void *priv, unsigned char *addr) 2353 2354 { 2354 2355 struct rk_priv_data *bsp_priv = priv; 2355 2356 struct device *dev = &bsp_priv->pdev->dev; 2356 2357 unsigned char ethaddr[ETH_ALEN * MAX_ETH] = {0}; 2357 2358 int ret,i, id = bsp_priv->bus_id; 2359 + printk("troy test id : %d\n",id);2358 2360 #if 0 2359 2361 rk_devinfo_get_eth_mac(addr); 2360 2362 if (is_valid_ether_addr(addr)) .. .. @@ -2388,19 +2390,32 @@ 2388 2390 } 2389 2391 #endif 2390 2392 #if 1 2391 - if (at24_mac_read(macaddr) > 0) {2392 - printk("ben %s: at24_mac_read Success!! \n", __func__);2393 - memcpy(addr, macaddr, 6);2394 -2395 - printk("Read the Ethernet MAC address from :");2396 - for (i = 0; i < 5; i++)2397 - printk("%2.2x:", addr[i]);2398 -2399 - printk("%2.2x\n", addr[i]);2400 - } else {2393 + if (id == 1 ){2394 + if (at24_mac_read(macaddr) > 0) {2395 + printk("ben %s: at24_mac_read Success!! \n", __func__);2396 + memcpy(addr, macaddr, 6);2397 + printk("Read the Ethernet MAC address from :");2398 + for (i = 0; i < 5; i++)2399 + printk("%2.2x:", addr[i]);2400 + } else {2401 2401 printk("ben %s: at24_mac_read Failed!! \n", __func__); 2402 2402 goto out; 2403 - }2403 + }2404 + }2405 + else2406 + {2407 + if (at24_mac1_read(macaddr) > 0) {2408 + printk("ben %s: at24_mac_read Success!! \n", __func__);2409 + memcpy(addr, macaddr, 6);2410 + printk("Read the Ethernet MAC address from :");2411 + for (i = 0; i < 5; i++)2412 + printk("%2.2x:", addr[i]);2413 + } else {2414 + printk("ben %s: at24_mac_read Failed!! \n", __func__);2415 + goto out;2416 + }2417 + }2418 +2404 2419 #endif 2405 2420 2406 2421 out: