JMicron jms561 umass on arm64?
Mark Millard
marklmi at yahoo.com
Sat Apr 10 20:37:42 UTC 2021
On 2021-Apr-10, at 12:34, Peter Cornelius <pcc at gmx.net> wrote:
> Thanks, Mark and Bob:
>
> Bingo. Indeed found the knob, see below.
>
>> Which are just pins 22 and 37 [7], [8] (blk.* just get the list of disks from Linux lsblk). So, it looks like that it boiled down to just setting the two pins to high, and the disks should be there (and gone if low)... That would be easy to test (and possible python for fan and display and so on to come later).
>>
>> I find that gpioctl -l reports 54 GPIO pins. How does that relate to the 58 pins the BCM2711 has [9]? I also seem blind to the way we are assigning the pins... /usr/src/sys/contrib/device-tree/src/arm/bcm2711-rpi-4-b.dts also lists 58 as in [9].
My understand is that FreeBSD's:
contrib/device-tree/src/arm/bcm2711-rpi-4-b.dts
is from the general linux import of device tree information but is
unused for RPi*'s: the .dtb used is from the RPi firmware --which
traces back to the likes of, for example, for tag 1.20210303 :
https://github.com/raspberrypi/linux/blob/raspberrypi-kernel_1.20210303-1/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
If the two *.dts* sets of sources happen to track, fine. But
if/when/where there are distinctions the relevant:
https://github.com/raspberrypi/linux/blob/raspberrypi-kernel*/. . .
material is what things are based on.
For lack of a tag being involved, finding the source that matches
is messier. Converting the .dtb back into a .dts may be more
reasonable and should work in general, even when tags are in
use. But it likely would not reproduces comments.
https://github.com/raspberrypi/linux/commits/rpi-5.10.y/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
can be looked at to see recent activity that goes beyond
the raspberrypi-kernel_1.20210303-1 material and also
likely does not match FreeBSD's:
contrib/device-tree/src/arm/bcm2711-rpi-4-b.dts
An example is:
ARM: dts: bcm2711: Add aliases for additional SPIs
being more recent than both. It is also more recent
than:
https://github.com/torvalds/linux/commits/master/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
and there are other commits not common with
torvalds/linux/commits/master/ .
> At least until 26, pin numbers reported by FreeBSD correspond to the GPIO numbers referred to elsewhere, and then can be located on the pinout like [8], [9], etc.
(From what I've read GPIO numbering and BCM numbering
match.)
Looking, gpio-line-names seems to have been stable for
about 14 months, where it was first added for the RPi
linux kernel:
https://github.com/raspberrypi/linux/commit/cd87c180b301e8eb7eee916fe6bb972962fe6904
It looks to happen to match the history under
torvalds/linux/commits/master/ .
Be warned that I've no background using these pins for
anything.
> Thanks for the reminder.
>
> Excellent.
>
> More to follow later (may be Whitsuntide time though, subject to work load until then).
>
> Cool. Time for a beer now.
>
> Cheers,
>
> Peter.
>
> ---
>
> [root at rpi4 ~]# gpioctl -c 25 OUT
> [root at rpi4 ~]# gpioctl 25 1
> [root at rpi4 ~]# Apr 10 19:21:21 rpi4 kernel: ugen0.3: <JMicron JMS56x Series> at usbus0
> Apr 10 19:21:21 rpi4 kernel: umass0 on uhub0
> Apr 10 19:21:21 rpi4 kernel: umass0: <MSC Bulk-Only Transfer> on usbus0
> Apr 10 19:21:21 rpi4 kernel: umass0: SCSI over Bulk-Only; quirks = 0x8000
> Apr 10 19:21:21 rpi4 kernel: umass0:0:0: Attached to scbus0
> Apr 10 19:21:21 rpi4 kernel: GEOM: new disk da0
> Apr 10 19:21:21 rpi4 kernel: pass0 at umass-sim0 bus 0 scbus0 target 0 lun 0
> Apr 10 19:21:21 rpi4 kernel: pass0: <ST5000LM 000-2AN170 8136> Fixed Direct Access SPC-4 SCSI device
> Apr 10 19:21:21 rpi4 kernel: pass0: Serial Number 1234567890123
> Apr 10 19:21:21 rpi4 kernel: pass0: 400.000MB/s transfers
> Apr 10 19:21:21 rpi4 kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
> Apr 10 19:21:21 rpi4 kernel: da0: <ST5000LM 000-2AN170 8136> Fixed Direct Access SPC-4 SCSI device
> Apr 10 19:21:21 rpi4 kernel: da0: Serial Number 1234567890123
> Apr 10 19:21:21 rpi4 kernel: da0: 400.000MB/s transfers
> Apr 10 19:21:21 rpi4 kernel: da0: 4769307MB (9767541168 512 byte sectors)
> Apr 10 19:21:21 rpi4 kernel: da0: quirks=0x2<NO_6_BYTE>
> Apr 10 19:21:21 rpi4 kernel: da0: Delete methods: <NONE(*),ZERO>
> Apr 10 19:21:21 rpi4 kernel: pass1 at umass-sim0 bus 0 scbus0 target 0 lun 1
> Apr 10 19:21:21 rpi4 kernel: pass1: <ST5000LM 000-2AN170 8136> Fixed Direct Access SPC-4 SCSI device
> Apr 10 19:21:21 rpi4 kernel: pass1: Serial Number 1234567890123
> Apr 10 19:21:21 rpi4 kernel: pass1: 400.000MB/s transfers
> Apr 10 19:21:21 rpi4 kernel: da1 at umass-sim0 bus 0 scbus0 target 0 lun 1
> Apr 10 19:21:21 rpi4 kernel: da1: <ST5000LM 000-2AN170 8136> Fixed Direct Access SPC-4 SCSI device
> Apr 10 19:21:21 rpi4 kernel: da1: Serial Number 1234567890123
> Apr 10 19:21:21 rpi4 kernel: da1: 400.000MB/s transfers
> Apr 10 19:21:21 rpi4 kernel: da1: 4769307MB (9767541168 512 byte sectors)
> Apr 10 19:21:21 rpi4 kernel: da1: quirks=0x2<NO_6_BYTE>
> Apr 10 19:21:21 rpi4 kernel: da1: Delete methods: <NONE(*),ZERO>
> Apr 10 19:21:21 rpi4 kernel: GEOM: new disk da1
> gpioctl 25 0
> [root at rpi4 ~]# Apr 10 19:22:54 rpi4 kernel: ugen0.3: <JMicron JMS56x Series> at usbus0 (disconnected)
> Apr 10 19:22:54 rpi4 kernel: umass0: at uhub0, port 2, addr 2 (disconnected)
> Apr 10 19:22:54 rpi4 kernel: pass0 at umass-sim0 bus 0 scbus0 target 0 lun 0
> Apr 10 19:22:54 rpi4 kernel: pass0: <ST5000LM 000-2AN170 8136> s/n 1234567890123 detached
> Apr 10 19:22:54 rpi4 kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
> Apr 10 19:22:54 rpi4 kernel: da0: <ST5000LM 000-2AN170 8136> s/n 1234567890123 detached
> Apr 10 19:22:54 rpi4 kernel: pass1 at umass-sim0 bus 0 scbus0 target 0 lun 1
> Apr 10 19:22:54 rpi4 kernel: pass1: <ST5000LM 000-2AN170 8136> s/n 1234567890123 detached
> Apr 10 19:22:54 rpi4 kernel: (pass0:umass-sim0:0:0:0): Periph destroyed
> Apr 10 19:22:54 rpi4 kernel: da1 at umass-sim0 bus 0 scbus0 target 0 lun 1
> Apr 10 19:22:54 rpi4 kernel: da1: <ST5000LM 000-2AN170 8136> s/n 1234567890123 detached
> Apr 10 19:22:54 rpi4 kernel: (pass1:umass-sim0:0:0:1): Periph destroyed
> Apr 10 19:22:54 rpi4 kernel: (da0:umass-sim0:0:0:0): Periph destroyed
> Apr 10 19:22:54 rpi4 kernel: (da1:umass-sim0:0:0:1): Periph destroyed
> Apr 10 19:22:54 rpi4 kernel: umass0: detached
Cool.
>>>> [1] I believe, https://www.jmicron.com/file/download/1026/JMS561_Product+Brief.pdf
>>>> [2] https://wiki.radxa.com/Dual_Quad_SATA_HAT
>>>> [3] Note: Later builds so far have not booted despite of current Firmware/Das U-Boot (March 2021)
>>>> FreeBSD rpi4 14.0-CURRENT FreeBSD 14.0-CURRENT #1: Tue Feb 23 02:30:31 UTC 2021
>>>> root at rpi4:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
>>>> [4] https://jamesachambers.com/raspberry-pi-4-bootloader-firmware-updating-recovery-guide/
>>>> [5] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252971
>> [6] https://github.com/akgnah/rockpi-sata
>> [7] https://www.tomshardware.com/reviews/raspberry-pi-gpio-pinout,6122.html
>> [8] https://www.raspberrypi.org/documentation/usage/gpio/
>> [9] https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf
>
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
More information about the freebsd-arm
mailing list