Tool/software:
I am porting u-boot to a board design based on the AM64x EVM. The board design does not use the CPSW gigabit switch, but has 4 ethernet ports, 2 port on each of the ICSSG PRU's. For the sake of simplicity, I am only focused on the 2 ethernet ports on the ICSSG0 PRU. I am using the u-boot code "ti-u-boot-2023.04+gitAUTOINC+8366064208" that is part of the SDK download.
My last adventure in u-boot was over 10 years ago (back when Freescale was still Freescale), so I am a bit new to the whole device tree concept. However I am used to diving into code to figure out what is going on. Hence the log will have some additional logging in it that I have put in.
For the device tree, in the k3-am64-main.dtsi I am referencing the "icssg0: icssg@30000000" already established in this file. The "k3-am642-evm.dts" source already had a reference to "iccsg1_eth" so I added the following to this source, and made changes for icssg0, and came up with the following. I am a bit unsure on the "dmas" portion, but it looked follow what others had done.
------------------------------------
icssg0_eth: icssg0-eth {
compatible = "ti,am642-icssg-prueth";
pinctrl-names = "default";
pinctrl-0 = <&mypruicssg0rgmii1_pins_default
&mypruicssg0rgmii2_pins_default>;
sram = <&oc_sram>;
ti,prus = <&pru0_0>, <&rtu0_0>, <&tx_pru0_0>, <&pru0_1>, <&rtu0_1>, <&tx_pru0_1>;
firmware-name = "ti-pruss/am64x-sr2-pru0-prueth-fw.elf",
"ti-pruss/am64x-sr2-rtu0-prueth-fw.elf",
"ti-pruss/am64x-sr2-txpru0-prueth-fw.elf",
"ti-pruss/am64x-sr2-pru1-prueth-fw.elf",
"ti-pruss/am64x-sr2-rtu1-prueth-fw.elf",
"ti-pruss/am64x-sr2-txpru1-prueth-fw.elf";
ti,pruss-gp-mux-sel = <2>, /* MII mode */
<2>,
<2>,
<2>, /* MII mode */
<2>,
<2>;
ti,mii-g-rt = <&icssg0_mii_g_rt>;
ti,mii-rt = <&icssg0_mii_rt>;
ti,iep = <&icssg0_iep0>, <&icssg0_iep1>;
interrupt-parent = <&icssg0_intc>;
interrupts = <24 0 2>, <25 1 3>;
interrupt-names = "tx_ts0", "tx_ts1";
dmas = <&main_pktdma 0xc100 15>, /* egress slice 0 */
<&main_pktdma 0xc101 15>, /* egress slice 0 */
<&main_pktdma 0xc102 15>, /* egress slice 0 */
<&main_pktdma 0xc103 15>, /* egress slice 0 */
<&main_pktdma 0xc104 15>, /* egress slice 1 */
<&main_pktdma 0xc105 15>, /* egress slice 1 */
<&main_pktdma 0xc106 15>, /* egress slice 1 */
<&main_pktdma 0xc107 15>, /* egress slice 1 */
<&main_pktdma 0x4100 15>, /* ingress slice 0 */
<&main_pktdma 0x4101 15>; /* ingress slice 1 */
dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
"tx1-0", "tx1-1", "tx1-2", "tx1-3",
"rx0", "rx1";
ethernet-ports {
#address-cells = <1>;
#size-cells = <0>;
icssg0_emac0: port@0 {
reg = <0>;
phy-handle = <&icssg0_phy1>;
phy-mode = "rgmii-id";
/* Filled in by bootloader */
local-mac-address = [00 00 00 00 00 00];
};
icssg0_emac1: port@1 {
reg = <1>;
phy-handle = <&icssg0_phy2>;
phy-mode = "rgmii-id";
/* Filled in by bootloader */
local-mac-address = [00 00 00 00 00 00];
};
};
};
----------------------------------------------
Later in the source file, outside of the root node, I have the followi
-------------------------------------------
&icssg0_mdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mypruicssg0mdio1_pins_default>;
icssg0_phy1: ethernet-phy@1 {
reg = <0x1>;
tx-internal-delay-ps = <250>;
rx-internal-delay-ps = <2000>;
};
icssg0_phy2: ethernet-phy@2 {
reg = <0x2>;
tx-internal-delay-ps = <250>;
rx-internal-delay-ps = <2000>;
};
};
------------------------------------------
The failure is occurring when enabling "clocks" The "icssg0_cfg" references the "k3_clks" node found in the "dmcs" node in the k3-am64-main.dtsi source. This has the driver compatibility for "ti,k2g-sci-clk", which I found in the "clk-sci.c driver source.
From the log, I can see the prueth_probe trying to start the MDIO for port0 and is trying to enable the clock, and sending a message to a "mailbox" found in the "k3-sec-proxy.c" sources. This is where I get more than a bit lost. I can see the following data being sent to the mailbox (found in "ti_sci.c" source, function ti_sci_do_xfer()): "00 01 0c f5 02", however it receives back the following data: "00 01 0c f5 00". The code will validate the acknowledged message via bit 2 in the 5th byte (seemingly the "flags" field). Since something cleared this bit (or did not set the bit), the function returns -ENODEV error. This message is placed in "IOMEM" type of memory. The log is shown below (I am not sure how far back I should go in this log) :
------------------------------------------
drivers/net/ti/icssg_prueth.c: icssg_ofdata_parse_phy: Begin
Using port0
prueth_probe: sram: addr 70000000 size 28000
prueth_probe: MDIO_NODE
ti_sci_clk_of_xlate(clk=00000000fdea6c68, args_count=2)
prueth_probe: Try and enable clock
drivers/clk/clk-uclass.c: clk_enable(clk=00000000fdea6c68)
clk_enable: Name :clock-controller
drivers/clk/ti/clk-sci.c: ti_sci_clk_enable(clk=00000000fdea6c68)
drivers/firmware/ti_sci.c: ti_sci_cmd_put_clock: BEGIN
drivers/firmware/ti_sci.c: ti_sci_set_clock_state: BEGIN
ti_sci_do_xfer: BEGIN: system-controller@44043000
ti_sci_do_xfer: mbox_send
k3MsgDump: sending: 14
00 01 0c f5 02 00 00 00 3e 00 00 00 03 01
mbox_send(chan=00000000fdea10c0, data=00000000fdea1108: To ADDR: 00000000fff359d0)
drivers/mailbox/k3-sec-proxy.c: k3_sec_proxy_send(chan=00000000fdea10c0, data=00000000fdea1108)
k3_sec_proxy_verify_thread: Begin
k3_sec_proxy_verify_thread: Reading message
k3_sec_proxy_verify_thread: Return 0
k3_sec_proxy_send: Message successfully sent on thread 13
ti_sci_do_xfer: mbox_send__end: rxLen 8
ti_sci_get_response: BEGIN
mbox_recv(chan=00000000fdea10d8, data=00000000fdea1108, timeout_us=10000000)
drivers/mailbox/k3-sec-proxy.c: k3_sec_proxy_recv(chan=00000000fdea10d8, data=00000000fdea1108)
k3_sec_proxy_verify_thread: Begin
k3_sec_proxy_verify_thread: Reading message
k3_sec_proxy_verify_thread: Return 0
k3_sec_proxy_recv: Message successfully received from thread 12
drivers/firmware/ti_sci.c: ti_sci_get_response: MBOXRecv: system-controller@44043000
drivers/firmware/ti_sci.c: ti_sci_get_response: end: ret 0
k3MsgDump: received: 8
00 01 0c f5 00 00 00 00
ti_sci system-controller@44043000: Message not acknowledged
Message not acknowledged
drivers/firmware/ti_sci.c: ti_sci_do_xfer: END: -19
ti_sci_set_clock_state: RET: -19
ti-sci-clk clock-controller: ti_sci_clk_enable: put_clock failed (-19)
Enable clock-controller failed
prueth icssg0-eth: clk_enable failed -19
drivers/net/ti/icssg_prueth.c: prueth_probe: Begin
drivers/firmware/ti_sci.c: ti_sci_set_device_state: BEGIN
ti_sci_do_xfer: BEGIN: system-controller@44043000
ti_sci_do_xfer: mbox_send
k3MsgDump: sending: 17
00 02 0c 0a 02 04 00 00 52 00 00 00 00 00 00 00 02
mbox_send(chan=00000000fdea10c0, data=00000000fdea1108: To ADDR: 00000000fff359d0)
drivers/mailbox/k3-sec-proxy.c: k3_sec_proxy_send(chan=00000000fdea10c0, data=00000000fdea1108)
k3_sec_proxy_verify_thread: Begin
k3_sec_proxy_verify_thread: Reading message
k3_sec_proxy_verify_thread: Return 0
k3_sec_proxy_send: Message successfully sent on thread 13
ti_sci_do_xfer: mbox_send__end: rxLen 8
ti_sci_get_response: BEGIN
mbox_recv(chan=00000000fdea10d8, data=00000000fdea1108, timeout_us=10000000)
drivers/mailbox/k3-sec-proxy.c: k3_sec_proxy_recv(chan=00000000fdea10d8, data=00000000fdea1108)
k3_sec_proxy_verify_thread: Begin
k3_sec_proxy_verify_thread: Reading message
k3_sec_proxy_verify_thread: Return 0
k3_sec_proxy_recv: Message successfully received from thread 12
drivers/firmware/ti_sci.c: ti_sci_get_response: MBOXRecv: system-controller@44043000
drivers/firmware/ti_sci.c: ti_sci_get_response: end: ret 0
k3MsgDump: received: 8
00 02 0c 0a 02 00 00 00
drivers/firmware/ti_sci.c: ti_sci_do_xfer: END: 0
-----------------------------------------
Being new to the whole mailbox/security proxy concept, my question revolves around who it receiving the mailbox message? Also, who is sending the message back? I am thinking that "the other side" of the mailbox is a system that is communicating to the hardware (mdio to the phy perhaps?) and is not getting the correct response, so did not se the acknowledge bit accordingly. Does this seem reasonable on what is going on? Is this a communication with the pru core, and it is not happy with something?
Many thanks with your help. If you need further information, please let me know.
Daryl