This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6548: PRU Ethernet in U-boot

Part Number: AM6548

Hello TI,

Let me describe my problem first. Under u-boot, I have successfully used ICSSG0 ehternet with the following script.

    setenv firmware_dir '/lib/firmware/ti-pruss'
    setenv ethact pruss0_eth
    setenv get_firmware_mmc 'load mmc 1:2 ${loadaddr} ${firmware_dir}/${firmware_file}'
    setenv start_icssg0 'rproc start 0; rproc start 1'
    setenv load_icssg0_pru0_fw 'setenv firmware_file am65x-pru0-prueth-fw.elf; setenv loadaddr 0x89000000; run get_firmware_mmc; rproc load 0 0x89000000 13040; rproc start 0'
    setenv load_icssg0_rtu0_fw 'setenv firmware_file am65x-rtu0-prueth-fw.elf; setenv loadaddr 0x8a000000; run get_firmware_mmc; rproc load 1 0x8a000000 5676; rproc start 1'
    setenv init_icssg0 'rproc init; run load_icssg0_pru0_fw; run load_icssg0_rtu0_fw'

First I executed 'run init_icssg0' to start icssg0. Then I found that I must execute this command 'run start_icssg0' before using icssg0 every time, for example using the command 'ping' or 'nfs' in the u-boot command shell! 

This is too much trouble. Is it possible to use icssg0 in a way that allows me to execute 'run start_icssg0' only once?

I tried to modify the driver source code so that the START command only runs once without running the STOP command. so I made the following changes in ‘u-boot/drivers/net/ti/icssg-prueth.c’

diff --git a/drivers/net/ti/icssg-prueth.c b/drivers/net/ti/icssg-prueth.c
index 67bbfb4ca6..c5c010dbdb 100644
--- a/drivers/net/ti/icssg-prueth.c
+++ b/drivers/net/ti/icssg-prueth.c
@@ -193,6 +193,13 @@ static int prueth_start(struct udevice *dev)
int ret, i;
char tx_chn_name[16];
char rx_chn_name[16];
+ static char flag = 0;
+
+ if (flag) {
+ return 0;
+ }
+
+ flag = 1;

icssg_class_set_mac_addr(priv->miig_rt[priv->ingress_icssg],
priv->ingress_slice,
@@ -308,6 +315,8 @@ static void prueth_stop(struct udevice *dev)
struct prueth *priv = dev_get_priv(dev);
int icssg = priv->ingress_icssg, slice = priv->ingress_slice;

+ return;
+
icssg_class_disable(priv->miig_rt[icssg], slice);

phy_shutdown(priv->phydev);

After making the above changes, under u-boot, before using ICSSG0, no longer need to run 'start_icssg0' , But icssg0 Ethernet does not work during booting the kernel.

Do you have a solution to save this problem?