I am trying to get initrd flashing working with my custom carrier board. I did not implement USB OTG into my design on the flashing port but its not something I can easily change now. I can flash fine with the standard flash.sh script, but since the initrd flash method requires device mode support, I cant get it to work normally. We need this for the mass flashing features and to be able to load the OS on to NVME.
My dtb has been set up so that the port is in OTG mode with dummy GPIO pins used for the ID and vbus detection. These pins are both pulled low. Setting both pins to active high results in host mode and active low in device mode. I have confirmed that it works in both modes. Here is the dt snippet of the USB configuration:
ports {
usb2-0 {
mode = "otg";
status = "okay";
//nvidia,oc-pin = <0>;
vbus-supply = <&vbus_0_reg>;
usb-role-switch;
connector {
compatible = "gpio-usb-b-connector", "usb-b-connector";
/* These are dummy gpios with int pd enabled. Present on int connector J11 as GPIO28/17*/
vbus-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
id-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(P, 4) GPIO_ACTIVE_HIGH>;
label = "micro-USB";
type = "micro";
//able-connected-on-boot = "USB_ROLE_DEVICE";
};
};
If I modify my dtb so that the port is always in device mode, it will flash but now that port cant be used as a host port. I have now created two dtbs, one is the standard DTB with the port in host mode, and another initrdflash dtb with it in device mode. I want to modify the initrd flashing scripts to use the initrdflash dtb only for the RCM boot, but flash the standard dtb. I could also convert this to an overlay if that is easier.
I modified the generate_rcm_bootcmd() function in l4t_initrd_flash_internal.sh to add an extra option for an external DTB but it causes an unhandled exception right after the UEFI exits. The serial debug log is attached.
generate_rcm_bootcmd()
{
local cmd
local cmdarg=
if [ -n "${OVERRIDE_RCM_DTB}" ] && [ -f "${OVERRIDE_RCM_DTB}" ]; then
cmdarg+="-d \"${OVERRIDE_RCM_DTB}\" "
fi
...
For example, board_config1.conf shall include the dtb that can run on your board.
Step 2, you need to use another board_config2 that contains the dtb which has ability to enable device mode and flash package from step1 to your board.
Thanks, glad to know this is possible.
I am still getting the unhandled exception in EL3 error though. Any ideas on what the cause might be? Once I figure out what is going on with the unhandled exception this should work. I started with a fresh L4T.
Side note - it appears the quotes you used are unicode quotes, when i pasted that into my terminal the command didnt run properly, replacing with standard ascii quotes fixed it.
I can flash both configs using flash.sh without any issues. usb device mode works with the initrd config and I can see it detecting on the host computer.
This is now solved. I had PCIe C6 (unsupported) turned on and the UEFI doesnt seem to like it, but works in other situations. Disabling C6 in the initrdflash dtb let me flash using the commands above.