User avatar
DavidWang
Posts: 4
Joined: Tue Mar 29, 2016 6:58 am

Re: Entering aarch64 execution state

Wed Mar 30, 2016 6:12 am

Hi dwelch67,
Thanks for your explanation.
I will try that with ATF.
Firstly, I need to collect information of the HW like memory map. Then do the port.

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Thu Mar 31, 2016 6:11 pm

Switching over to swarren's 64bit u-boot, I'm able to get u-boot to work through the serial cable in addition to the display. Here is my complete config.txt

Code: Select all

force_turbo=0
core_freq=250
enable_uart=1
arm_control=0x200
kernel_old=1
disable_commandline_tags=1
kernel=u-boot.bin


Things will work without the first two lines, but I found them necessary to get stable and reliable output through the miniUART. Otherwise I get dropped characters and occasional garbage.

I'm still not able to get the 64 bit kernel to print anything to the console. Not even garbage. I'm starting to think that perhaps a conflict exists because the u-boot boatload is using the miniUART and the 64 bit linux kernel is expecting to use the main UART with the pins mapped back to the old location. Has anybody else gotten 64 bit to boot from swarren's u-boot version?

At this point I can't tell if the build of the 64 bit kernel is completely tanked or if it just isn't able to print the usual boot logging to the serial port. If nobody has any other suggestions, I'm going to try and see if I can get the RPI 3 to toggle a GPIO pin or flash one of the LEDs during bootup to see how far it is getting.

BTW, since u-boot can write text to the display, I'm wondering why a 64 bit linux port couldn't either. At least a virtual terminal in frame buffer mode. No 3D or anything like that of course. Since u-boot appears to partially be a hacked up linux kernel, I'm wondering why this wouldn't be possible.

Thanks.

swarren
Posts: 45
Joined: Tue Mar 01, 2016 5:56 am

Re: Entering aarch64 execution state

Thu Mar 31, 2016 6:23 pm

Electron752, do you have the latest FW? If so, I suggest you mention your UART stability issue in https://github.com/raspberrypi/firmware/issues/553 "Raspberry Pi 3 model B Serial console does not use correct baudrate".

Are you running an upstream or RPi Foundation version of the kernel? Either way, you may want to talk to Eric Anholt (the upstream bcm283x maintainer) e.g. on IRC freenode #raspberrypi-kernel. I know he's been looking at a 64-bit kernel.

You will definitely have to modify the kernel to use the mini UART. This is nothing to do with U-Boot, but simply because the mini UART is the FW default. If you don't want to do that, you'd want to load the "BT miniuart" overlay via config.txt, and modify the U-Boot source so it uses the PL011 UART instead. That should be very easy to do. Note that if you get the U-Boot modifications wrong, it will probably hang early on so you will see nothing on the UART or HDMI.

To debug early kernel boot issues, you will want to enable DEBUG_LL and EARLYPRINTK in .config /and/ provide relevant kernel command-line arguments to enable earlyprintk support (add "earlyprintk") and tell the kernel what address to use for the UART (I don't recall the exact option for that since I haven't used earlyprintk on arm64 yet).

For the first kernel bringup, once you get early UART spew working, I would certainly recommend disabling any VideoCore/graphics/multimedia/... support, and just enable UART console and the "simplefb" driver. That should get you unaccelerated graphics output from the kernel; enough even to run X.

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Thu Mar 31, 2016 6:53 pm

swarren wrote: Electron752, do you have the latest FW? If so, I suggest you mention your UART stability issue in https://github.com/raspberrypi/firmware/issues/553 "Raspberry Pi 3 model B Serial console does not use correct baudrate".

Are you running an upstream or RPi Foundation version of the kernel? Either way, you may want to talk to Eric Anholt (the upstream bcm283x maintainer) e.g. on IRC freenode #raspberrypi-kernel. I know he's been looking at a 64-bit kernel.
swarren:

The miniUART stability issues appear to be well known at this point, and it appears not much can't be done about it due to hardware limitations resulting from not all of the clocks on the SOC being independent.

See this topic:
viewtopic.php?f=44&t=142112

As for the port I'm using, I'm referring to marcus's port posted on this topic. Other people appear to have gotten it to work, but I can't. And yes, it appears to be dependent on the main UART as the console.

I might try porting the linux kernel to 64bit, but it does seem like alot of work. I still may make an attempt. Thanks for all the extra information on debugging the linux kernel!

swarren
Posts: 45
Joined: Tue Mar 01, 2016 5:56 am

Re: Entering aarch64 execution state

Thu Mar 31, 2016 6:57 pm

The entire point of "enable_uart=1" is to fix the SoC clocks so that the mini UART is stable. The issue is indeed well known, and that is the fix for it. If that's not working, with the latest firmware, it should be reported.

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Thu Mar 31, 2016 7:26 pm

BTW, I'm not trying to argue. Just understand...

I've been getting the firmware from https://github.com/raspberrypi/firmware ... aster/boot. I'm not sure which is the latest and greatest branch. Is it master or next?

When I tried next a few days ago, nothing would boot not even stock Raspbian. Although it appears that next has had a checkin in the last 4 hours and it does appear to deal with clocks.

swarren
Posts: 45
Joined: Tue Mar 01, 2016 5:56 am

Re: Entering aarch64 execution state

Thu Mar 31, 2016 7:29 pm

Yes, I believe that's the firmware repo I used, and I used the master branch.

swarren
Posts: 45
Joined: Tue Mar 01, 2016 5:56 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 3:18 am

FYI, RPi 3 64-bit support patches are posted for inclusion into mainline U-Boot:

http://lists.denx.de/pipermail/u-boot/2 ... 50314.html
[PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined

http://lists.denx.de/pipermail/u-boot/2 ... 50315.html
[PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config

User avatar
schorsch76
Posts: 22
Joined: Sun Apr 28, 2013 8:01 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 8:00 am

With the gentoo community i got a native gcc on the pi3 running. I try to get the usb working with zeldin (marcus_c) kernel.

I tried to use the dwg_otg kernel module but it fails to compile in aarch64. So i tried to find out what is wrong with the dwc2 kernel module, which is used at zeldin kernel. The Usb Hub gets recognized.
This is the dwc2 usb.

Code: Select all

Pi_3 64_bit sys # lsusb
Bus 001 Device 001: ID 1d6b:0002  
Pi_3 64_bit sys # 
When i look at the pcb i see the LAN9514 chip. This chip is the heart of the pi3 to connect to the outside world.
http://ww1.microchip.com/downloads/en/D ... c/9514.pdf
On page 6 we see the inner structure of it.

In the binding description of the dwc2 module we need to bind the phy (the LAN9514) to it.
http://lxr.free-electrons.com/source/Do ... b/dwc2.txt
The LAN9514 chip has its module named smsc95xx . But there is no compatibe line found that i could use.

There is second thing i noticed is:

Code: Select all

[    0.187217] 3f980000.usb supply vusb_d not found, using dummy regulator
[    0.187246] 3f980000.usb supply vusb_a not found, using dummy regulator
[    0.365674] dwc2 3f980000.usb: new USB bus registered, assigned bus number 1

[email protected] ~/intern/Dokumente/Entwicklung/rpi3/src/linux-2.6 $ grep -riHn "not found, using dummy regulator" drivers/*
drivers/regulator/core.c:1572:      pr_warn("%s supply %s not found, using dummy regulator\n",	

   /*
    * Assume that a regulator is physically present and enabled
    * even if it isn't hooked up and just provide a dummy.
    */
   if (have_full_constraints() && allow_dummy) {
      pr_warn("%s supply %s not found, using dummy regulator\n",
         devname, id);

      rdev = dummy_regulator_rdev;
      get_device(&rdev->dev);
      goto found;
   /* Don't log an error when called from regulator_get_optional() */
   } else if (!have_full_constraints() || exclusive) {
      dev_warn(dev, "dummy supplies not allowed\n");
   }


So i added

Code: Select all

	regulators {
	  vusb_d_reg: vusb_d_reg {
		 regulator-name = "vusb_d";
		 regulator-min-microvolt = <3300000>;
		 regulator-max-microvolt = <3300000>;
		 regulator-always-on;
		 status = "okay";
	  };

	  vusb_a_reg: vusb_a_reg {
		 regulator-name = "vusb_a";
		 regulator-min-microvolt = <3300000>;
		 regulator-max-microvolt = <3300000>;
		 regulator-always-on;
		 status = "okay";
	  };
	};

	soc {
		[email protected] {
			vusb_d = <&vusb_d_reg>;
			vusb_a = <&vusb_a_reg>;
			status = "okay";
		};
	};
To the device tree. Now it sees the regulators but i still dont see the LAN9514. I just assume that the chip is same bound to the CPU as in the RPI2.1
First: I dont know if the LAN9514 needs to be turned on with vusb_a/d.
Second: How to bind it as a "usb2-phy" to the [email protected] node without a compatible line in the module?

The first question could the raspberry pi foundation answer, when she is not gagged by a subponea or NDA or whatever. Maybe one of this things is the reason why they don't release a schematic for the Pi3 as they did for the previous pi's.

Any hint or idea could be useful to get the Pi2 "talking" to the LAN9514 chip....

Documentation i found about it:
http://ww1.microchip.com/downloads/en/D ... c/9514.pdf
https://www.raspberrypi.org/documentati ... matics.pdf
http://lxr.free-electrons.com/source/Do ... b/dwc2.txt
http://lxr.free-electrons.com/source/Do ... ndings.txt
http://lxr.free-electrons.com/source/Do ... on/phy.txt
http://lxr.free-electrons.com/source/Do ... -model.txt
http://devicetree.org/Device_Tree_Usage

Information fromt he 32 Bit Pi userland:

Code: Select all

[    1.788027] smsc95xx v1.0.4
[    1.959106] console [ttyAMA0] enabled
[    1.965149] uart-pl011 3f201000.uart: no DMA platform data
[    1.980303] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:a5:86:f8

Pi3_32 ~ # lsusb
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
It uses smsc95xx too.
Regards
Georg

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 8:18 am

schorsch76 wrote:With the gentoo community i got a native gcc on the pi3 running.
Silly question, but why build a 64 bit userland when it already available pre-compiled from the stretch/sid Debian linux distribution. I was able to build a complete arm64 bit userland from a Debian PC by using a combination of debootstrap and qemu-static. The basic idea is that you run debootstrap with the --foreign flag, then when it finishes copy qemu-static into the tree and chroot into it. The linux kernel will call the emulator to emulate aarch64, and it's then possible to run debootstrap --second-stage. After that runs, all that's required to install more things is to run apt just like any other install.

The only thing I'm missing of course is getting the aarch64 linux kernel to boot on my RPI 3 which I'm unable to get working for some reason so that I can actually run the 64bit user land on the RPI 3.
schorsch76 wrote: First: I dont know if the LAN9514 needs to be turned on with vusb_a/d.
Second: How to bind it as a "usb2-phy" to the [email protected] node without a compatible line in the module?

The first question could the raspberry pi foundation answer, when she is not gagged by a subponea or NDA or whatever. Maybe one of this things is the reason why they don't release a schematic for the Pi3 as they did for the previous pi's.

Any hint or idea could be useful to get the Pi2 "talking" to the LAN9514 chip....
Again, this is a silly observation but since the LAN9514 chip is a usb hub with the ethernet attached through the hub, I would think that once the USB OTG module is working the normal USB enumeration process would detect the lan component of the chip and the linux kernel will get back a PID/VID combo just like any other component. Internally the linux kernel uses the PID/VID combo to load the driver module through the normal probe mechanism. So I don't see why anything from the LAN9514 would need to be included in the device tree.

User avatar
schorsch76
Posts: 22
Joined: Sun Apr 28, 2013 8:01 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 8:29 am

Because i want to run gentoo on it. That is a valid linux distro too.

The point of my observations is, that it is not working. It 64 Pi3 tries it, but it is not working. That is why i am digging through the documentation and i want to post them here, because i think we could get it working together.

Code: Select all

usb 1-1: new high-speed USB device number 3 using dwc2
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 360K (ffffffc000823000 - ffffffc00087d000)
usb 1-1: device descriptor read/all, error -61
INIT: version 2.88 booting
usb 1-1: new high-speed USB device number 4 using dwc2
usb 1-1: device descriptor read/8, error -61
random: nonblocking pool is initialized
usb 1-1: device descriptor read/8, error -61
Please stay polite and don't judge someone's observations as silly.

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 8:52 am

schorsch76 wrote:Because i want to run gentoo on it. That is a valid linux distro too.

The point of my observations is, that it is not working. It 64 Pi3 tries it, but it is not working. That is why i am digging through the documentation and i want to post them here, because i think we could get it working together.

Code: Select all

usb 1-1: new high-speed USB device number 3 using dwc2
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 360K (ffffffc000823000 - ffffffc00087d000)
usb 1-1: device descriptor read/all, error -61
INIT: version 2.88 booting
usb 1-1: new high-speed USB device number 4 using dwc2
usb 1-1: device descriptor read/8, error -61
random: nonblocking pool is initialized
usb 1-1: device descriptor read/8, error -61
Please stay polite and don't judge someone's observations as silly.
I meant my observations are silly. Not yours. And I agree gentoo is a completely valid distro. I'm just saying for testing purposes, debian is already compiled.

I suspect the dwc2 module isn't working correctly. I think once that works, the normal USB enumation process should pick up the hub and the lan component.

I do have a USB bus analyzer, but since everything is soldered down I don't know if it's going to be much help.

I'm perfectly willing to help and I agree the more people helping the better. I'm just stuck getting the kernel to even print anything on the UART although I do have a working u-boot. If you have a precompiled kernel that works and possibly the source with it I can try it out on my RPI 3 and see if I can come up with any improvements or suggestions.

Thanks.

User avatar
schorsch76
Posts: 22
Joined: Sun Apr 28, 2013 8:01 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 9:08 am

Here is my p1 partition. It boots

http://www.schorsch-tech.de/rpi3/p1-64.tar.gz

The source of the kernel is zeldin at github
https://github.com/zeldin/linux/tree/rpi3

It is his https://github.com/zeldin/linux/blob/rp ... _defconfig used.

As i think about it, i guess it might be the usb clock or something like this: This errors often appear when there is a bad cable around...... :?

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 9:18 am

Cool, I'll try it in a few minutes.

Do you have any suggestions on how to attach a USB bus analyzer to the board? My analyzer expects to be in between the host and the peripheral. With it it would be very, very easy to find USB related issues.

Also, u-boot has working USB and lan. Since the u-boot source appears to be from a old version of the linux kernel I wonder if it would be possible to use it's source code as a reference?

User avatar
schorsch76
Posts: 22
Joined: Sun Apr 28, 2013 8:01 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 9:26 am

Ok, then i delete it again from the server.

About the u-boot ... good question. I try to look at the src.

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 10:13 am

OK, this is really a long shot but it looks like something needs to activate the GPIO6 pin on the SOC to bring the LAN part of the USB HUB/Lan module out of reset. I don't know if anything is doing that since this is a stock kernel base. I'll try and see if I can fix this and recompile the kernel.

The errors mean that the OTG module is receiving garbage from the LAN part of the chip.

Finally, with this kernel I'm able to completely run 64bit userland installed from Debian!!!!!!!!!!!!!!!!!!!!!!!!!!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5162
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Entering aarch64 execution state

Sat Apr 02, 2016 11:09 am

Electron752 wrote:Finally, with this kernel I'm able to completely run 64bit userland installed from Debian!!!!!!!!!!!!!!!!!!!!!!!!!!
Results of a simple benchmark (e.g. nbench) with 32bit and 64bit debian would be interesting.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5162
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Entering aarch64 execution state

Sat Apr 02, 2016 11:13 am

Electron752 wrote:OK, this is really a long shot but it looks like something needs to activate the GPIO6 pin on the SOC to bring the LAN part of the USB HUB/Lan module out of reset. I don't know if anything is doing that since this is a stock kernel base. I'll try and see if I can fix this and recompile the kernel.
That should be handled by the firmware before the kernel boots, so shouldn't be any different between 32-bit and 64-bit.

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 11:56 am

When I see a new processor, I like to run the old bytecpu benchmark that was famous back in 1995. I ran it in both 32bit mode and 64bit mode, and I'm seeing about a 2x speed improvement. It's possible something goofy might be going on such as something being wrong with the system clocks, but this is more then I expected....

Both are on the RPI 3 with the benchmark compiled with gcc (Debian 5.3.1-13) 5.3.1 20160323 with -O3.

64 bit(stock debian sid with aarch64+kernel posted here)
===========OVERALL============
INTEGER INDEX: 36.969897
FLOATING-POINT INDEX: 15.712441
(90 MHz Dell Pentium = 1.00)
==============================

32 bit( stock debian sid with armhf+foundation linux kernel)
===========OVERALL============
INTEGER INDEX: 15.779668
FLOATING-POINT INDEX: 7.787629
(90 MHz Dell Pentium = 1.00)
==============================

Full Results:

64 bit(stock debian sid with aarch64+kernel posted here)
BBBBBB YYY Y TTTTTTT EEEEEEE
BBB B YYY Y TTT EEE
BBB B YYY Y TTT EEE
BBBBBB YYY Y TTT EEEEEEE
BBB B YYY TTT EEE
BBB B YYY TTT EEE
BBBBBB YYY TTT EEEEEEE

BYTEmark (tm) Native Mode Benchmark ver. 2 (3/95)
NUMERIC SORT: Iterations/sec.: 566.568806 Index: 14.641913
STRING SORT: Iterations/sec.: 159.014718 Index: 69.896579
BITFIELD: Iterations/sec.: 173263215.176905 Index: 29.720125
FP EMULATION: Iterations/sec.: 143.255167 Index: 68.872676
FOURIER: Iterations/sec.: 9207.692532 Index: 10.425849
ASSIGNMENT: Iterations/sec.: 12.412932 Index: 47.292764
IDEA: Iterations/sec.: 2580.123043 Index: 39.475567
HUFFMAN: Iterations/sec.: 868.551880 Index: 24.136498
NEURAL NET: Iterations/sec.: 8.215561 Index: 13.901118
LU DECOMPOSITION: Iterations/sec.: 453.385736 Index: 26.767371
...done...
===========OVERALL============
INTEGER INDEX: 36.969897
FLOATING-POINT INDEX: 15.712441
(90 MHz Dell Pentium = 1.00)
==============================

32 bit( stock debian sid with armhf+foundation linux kernel)
BBBBBB YYY Y TTTTTTT EEEEEEE
BBB B YYY Y TTT EEE
BBB B YYY Y TTT EEE
BBBBBB YYY Y TTT EEEEEEE
BBB B YYY TTT EEE
BBB B YYY TTT EEE
BBBBBB YYY TTT EEEEEEE

BYTEmark (tm) Native Mode Benchmark ver. 2 (3/95)
NUMERIC SORT: Iterations/sec.: 310.422260 Index: 8.022284
STRING SORT: Iterations/sec.: 40.280334 Index: 17.705641
BITFIELD: Iterations/sec.: 80378261.920710 Index: 13.787416
FP EMULATION: Iterations/sec.: 41.800716 Index: 20.096498
FOURIER: Iterations/sec.: 3951.514952 Index: 4.474291
ASSIGNMENT: Iterations/sec.: 5.594697 Index: 21.315566
IDEA: Iterations/sec.: 1381.238036 Index: 21.132773
HUFFMAN: Iterations/sec.: 494.479963 Index: 13.741280
NEURAL NET: Iterations/sec.: 5.703186 Index: 9.650061
LU DECOMPOSITION: Iterations/sec.: 185.289280 Index: 10.939266
...done...
===========OVERALL============
INTEGER INDEX: 15.779668
FLOATING-POINT INDEX: 7.787629
(90 MHz Dell Pentium = 1.00)
==============================

User avatar
schorsch76
Posts: 22
Joined: Sun Apr 28, 2013 8:01 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 12:13 pm

I compiled dwc2 now as a module with debug information enabled. I got this [1] log.
[1] https://bpaste.net/show/724d0529238c

Interesting for me seems:

Code: Select all

[  242.873720] dwc2 3f980000.usb: SetPortFeature
[  242.873724] dwc2 3f980000.usb: SetPortFeature - USB_PORT_FEAT_RESET
[  242.873729] dwc2 3f980000.usb: In host mode, hprt0=00001101
[  242.944047] dwc2 3f980000.usb: gintsts=05000029  gintmsk=f3000806
[  242.945649] dwc2 3f980000.usb: DWC OTG HCD HUB STATUS DATA: Root port status changed
[  242.945653] dwc2 3f980000.usb:   port_connect_status_change: 0
[  242.945657] dwc2 3f980000.usb:   port_reset_change: 1
[  242.945661] dwc2 3f980000.usb:   port_enable_change: 1
[  242.945665] dwc2 3f980000.usb:   port_suspend_change: 0
[  242.945668] dwc2 3f980000.usb:   port_over_current_change: 0
[  242.997666] dwc2 3f980000.usb: ClearPortFeature USB_PORT_FEAT_C_RESET
[  243.053653] usb 1-1: new high-speed USB device number 4 using dwc2
[  243.053693] dwc2 3f980000.usb: --Host Channel 1 Interrupt: STALL Received--
[  243.193647] dwc2 3f980000.usb: DWC OTG HCD HUB STATUS DATA: Root port status changed
[  243.193657] dwc2 3f980000.usb:   port_connect_status_change: 0
[  243.193661] dwc2 3f980000.usb:   port_reset_change: 0
[  243.193665] dwc2 3f980000.usb:   port_enable_change: 1
[  243.193668] dwc2 3f980000.usb:   port_suspend_change: 0
[  243.193672] dwc2 3f980000.usb:   port_over_current_change: 0
[  243.264687] dwc2 3f980000.usb: --Host Channel 3 Interrupt: STALL Received--
It tries ti reset and enable the port but it receives a STALL ... :?

User avatar
schorsch76
Posts: 22
Joined: Sun Apr 28, 2013 8:01 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 12:27 pm

The cpu is fixed at 1.2 GHz running. ;)

Code: Select all

Pi_3 64_bit sys # find . | grep freq
./firmware/devicetree/base/soc/[email protected]/clock-frequency
./firmware/devicetree/base/cpus/[email protected]/clock-frequency
./firmware/devicetree/base/cpus/[email protected]/clock-frequency
./firmware/devicetree/base/cpus/[email protected]/clock-frequency
./firmware/devicetree/base/cpus/[email protected]/clock-frequency
./firmware/devicetree/base/timer/clock-frequency
./firmware/devicetree/base/clocks/[email protected]/clock-frequency

Pi_3 64_bit sys # cat ./firmware/devicetree/base/cpus/[email protected]/clock-frequency | hexdump -C
00000000  47 86 8c 00                                       |G...|
00000004

Code: Select all

[email protected] ~/Dokumente/Entwicklung/rpi3/src/linux-2.6 $ wcalc -d -P10 0x47868c00
 = 1200000000.0000000000

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 12:42 pm

schorsch76 wrote: It tries ti reset and enable the port but it receives a STALL ... :?
I was looking at the error code from the device descriptor read, and I think the OTG module is receiving garbage. Possibly sending garbage. The stall just means that the device received an unknown request. The get device descriptor request is typically the first request received.

I really wish I could figure out a way to hook up a bus analyzer to this board. Too bad the USB lines aren't broken out.

swarren
Posts: 45
Joined: Tue Mar 01, 2016 5:56 am

Re: Entering aarch64 execution state

Sat Apr 02, 2016 2:55 pm

Re: the LAN_RUN signal (9514 reset) - is the GPIO used, or signal polarity, different between different Pi variants? If using the upstream kernel, it could be that it's doing some GPIO/pinmux initialization that hasn't been fully updated for the RPi3, in either bit size.

Dom, Is there a list of which GPIOs (in particular from the second bank which IIRC is reserved for VC core usage on more recent Pis) are used for what?

Electron752
Posts: 142
Joined: Mon Mar 02, 2015 7:09 pm

Re: Entering aarch64 execution state

Sat Apr 02, 2016 2:57 pm

OK, I've made some progress! I can get the 64bit kernel to successfully enumerate the USB bus now. I isolated the problem to be that the DMA support is broken for the DWC2 driver. If DMA is disabled, then the USB bus can correctly be enumerated. The trick is to force DMA to be disabled.

Code: Select all

--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -3163,9 +3163,9 @@ void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
        dev_dbg(hsotg->dev, "%s()\n", __func__);
 
        dwc2_set_param_otg_cap(hsotg, params->otg_cap);
-       dwc2_set_param_dma_enable(hsotg, params->dma_enable);
-       dwc2_set_param_dma_desc_enable(hsotg, params->dma_desc_enable);
-       dwc2_set_param_dma_desc_fs_enable(hsotg, params->dma_desc_fs_enable);
+       dwc2_set_param_dma_enable(hsotg, 0);
+       dwc2_set_param_dma_desc_enable(hsotg, 0);
+       dwc2_set_param_dma_desc_fs_enable(hsotg, 0);
        dwc2_set_param_host_support_fs_ls_low_power(hsotg,
                        params->host_support_fs_ls_low_power);
        dwc2_set_param_enable_dynamic_fifo(hsotg,

Code: Select all

[email protected]:/# lsusb
Bus 001 Device 005: ID 0b38:0010 Gear Head 107-Key Keyboard
Bus 001 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Unfortunately, the kernel hangs when I try to bring up the network interface with ifup. I don't know if there are some more issues with the USB driver, or if it's the network device driver. I might try attaching a external USB attached network device to see if I can get networking to work at all.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5162
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Entering aarch64 execution state

Sat Apr 02, 2016 4:10 pm

swarren wrote:Dom, Is there a list of which GPIOs (in particular from the second bank which IIRC is reserved for VC core usage on more recent Pis) are used for what?
I guess this is the best source for GPU GPIO usage:
https://github.com/raspberrypi/firmware ... t-blob.dts

Return to “Bare metal, Assembly language”