@@ -76,15 +76,30 @@ https://github.com/lupyuen/pinephone-nuttx-usb/blob/b80499b3b8ec837fe2110e9476e8
7676TODO
7777
7878``` text
79- DEBUGASSERT(sizeof(struct ehci_overlay_s) == SIZEOF_EHCI_OVERLAY);
79+ a64_ehci_initialize: sizeof(struct a64_qh_s)=72
80+ a64_ehci_initialize: sizeof(struct a64_qtd_s)=32
81+ a64_ehci_initialize: sizeof(struct ehci_itd_s)=64
82+ a64_ehci_initialize: sizeof(struct ehci_sitd_s)=28
83+ a64_ehci_initialize: sizeof(struct ehci_qtd_s)=32
84+ a64_ehci_initialize: sizeof(struct ehci_overlay_s)=32
85+ a64_ehci_initialize: sizeof(struct ehci_qh_s)=48
86+ a64_ehci_initialize: sizeof(struct ehci_fstn_s)=8
8087```
8188
82- TODO
89+ a64_qh_s Now: 48 + 8 + 4 + 8 = 68
8390
84- ``` text
85- sizeof(struct ehci_overlay_s)=32
91+ Align to 32-bit = 72
92+
93+ Need to align to 0x20 = 32
94+
95+ Pad to 96
96+
97+ ``` c
98+ uint8_t pad2[96 - 72 ]; // TODO: Pad from 72 to 96 bytes for 64-bit platform
8699```
87100
101+ a64_qh_s Previously: 48 + 4 + 4 + 8 = 64
102+
88103# Output Log
89104
90105``` text
@@ -114,8 +129,8 @@ Found U-Boot script /boot.scr
114129653 bytes read in 3 ms (211.9 KiB/s)
115130## Executing script at 4fc00000
116131gpio: pin 114 (gpio 114) value is 1
117- 348854 bytes read in 21 ms (15.8 MiB/s)
118- Uncompressed size: 10514432 = 0xA07000
132+ 356655 bytes read in 20 ms (17 MiB/s)
133+ Uncompressed size: 10534912 = 0xA0C000
11913436162 bytes read in 5 ms (6.9 MiB/s)
1201351078500 bytes read in 50 ms (20.6 MiB/s)
121136## Flattened Device Tree blob at 4fa00000
@@ -125,35 +140,24 @@ Uncompressed size: 10514432 = 0xA07000
125140
126141Starting kernel ...
127142
128- usbhost_registerclass: Registering class:0x40120658 nids:2
129- a64_ehci_initialize: sizeof(struct a64_qh_s)=72
143+ usbhost_registerclass: Registering class:0x40124838 nids:2
144+ a64_ehci_initialize: sizeof(struct a64_qh_s)=96
130145a64_ehci_initialize: sizeof(struct a64_qtd_s)=32
131- _assert: Current Version: NuttX 12.0.3 4d922be-dirty Mar 7 2023 15:54:47 arm64
132- _assert: Assertion failed : at file: chip/a64_ehci.c:4996 task: nsh_main 0x4008b0d0
133- up_dump_register: stack = 0x40129660
134- up_dump_register: x0: 0x40129660 x1: 0xa
135- up_dump_register: x2: 0x20 x3: 0x400efb22
136- up_dump_register: x4: 0x4a10 x5: 0x0
137- up_dump_register: x6: 0x4 x7: 0x88
138- up_dump_register: x8: 0x40a88268 x9: 0x0
139- up_dump_register: x10: 0x1105000 x11: 0x5
140- up_dump_register: x12: 0x0 x13: 0x1
141- up_dump_register: x14: 0x0 x15: 0x1c28000
142- up_dump_register: x16: 0x0 x17: 0x1
143- up_dump_register: x18: 0x0 x19: 0x0
144- up_dump_register: x20: 0x40a8d010 x21: 0x400ef92d
145- up_dump_register: x22: 0x0 x23: 0x1384
146- up_dump_register: x24: 0x4011e6fe x25: 0x40120000
147- up_dump_register: x26: 0x0 x27: 0x0
148- up_dump_register: x28: 0x0 x29: 0x0
149- up_dump_register: x30: 0x4008b078
150- up_dump_register:
151- up_dump_register: STATUS Registers:
152- up_dump_register: SPSR: 0x40000005
153- up_dump_register: ELR: 0x40081000
154- up_dump_register: SP_EL0: 0x40a8f300
155- up_dump_register: SP_ELX: 0x40a8f250
156- up_dump_register: TPIDR_EL0: 0x40a8d010
157- up_dump_register: TPIDR_EL1: 0x40a8d010
158- up_dump_register: EXE_DEPTH: 0xffffffffffffffff
146+ a64_ehci_initialize: sizeof(struct ehci_itd_s)=64
147+ a64_ehci_initialize: sizeof(struct ehci_sitd_s)=28
148+ a64_ehci_initialize: sizeof(struct ehci_qtd_s)=32
149+ a64_ehci_initialize: sizeof(struct ehci_overlay_s)=32
150+ a64_ehci_initialize: sizeof(struct ehci_qh_s)=48
151+ a64_ehci_initialize: sizeof(struct ehci_fstn_s)=8
152+ EHCI Initializing EHCI Stack
153+ a64_printreg: 01c1b010<-00000000
154+ a64_printreg: 01c1b014->00000000
155+ EHCI ERROR: Timed out waiting for HCHalted. USBSTS: 000000
156+ EHCI ERROR: a64_reset failed: 110
157+ a64_usbhost_initialize: ERROR: a64_ehci_initialize failed
158+ ERROR: Couldn't start usb -19
159+ nsh: mkfatfs: command not found
160+
161+ NuttShell (NSH) NuttX-12.0.3
162+ nsh>
159163```
0 commit comments