Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 2021 13:37:34 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Peter Cornelius <pcc@gmx.net>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, bob prohaska <fbsd@www.zefox.net>
Subject:   Re: JMicron jms561 umass on arm64?
Message-ID:  <6386F7D9-2175-4015-8EDA-838C8125AFED@yahoo.com>
In-Reply-To: <trinity-eac018d9-79d7-4638-8c9c-72e9a98e919a-1618083267046@3c-app-gmx-bap27>
References:  <trinity-96292338-af50-4ea1-a4cf-0afcd97dfe35-1617806989816@3c-app-gmx-bs02> <20210407153732.GA50562@www.zefox.net> <trinity-2bcace35-09e8-4e81-87be-53287568c3c1-1617827433585@3c-app-gmx-bs02> <20210407211513.GA53438@www.zefox.net> <trinity-c3148d05-2413-4522-b67d-8be37f8c0dad-1617868014706@3c-app-gmx-bs02> <A2E9C605-ABB3-40E3-931C-7FB10CDD0990@yahoo.com> <20210408150934.GA99223@www.zefox.net> <694B7C84-E627-4E17-9148-4C4BB54FAD17@yahoo.com> <trinity-93090f7c-f2f9-4cec-8b27-1af7de718f7a-1617905889857@3c-app-gmx-bs32> <5099D78C-6656-4E4A-9F20-23F31A4397FE@yahoo.com> <trinity-17aa86d8-be8c-434e-9815-443ce0ce0d54-1617993216878@3c-app-gmx-bs30> <7B26049E-BA67-4E23-A558-2D29CB65108A@yahoo.com> <trinity-13b73107-a234-4c06-873e-a6d5dd3c46ac-1618069666636@3c-app-gmx-bap64> <trinity-eac018d9-79d7-4638-8c9c-72e9a98e919a-1618083267046@3c-app-gmx-bap27>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-Apr-10, at 12:34, Peter Cornelius <pcc at gmx.net> wrote:

> Thanks, Mark and Bob:
>=20
> Bingo. Indeed found the knob, see below.
>=20
>> 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).
>>=20
>> 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.

(=46rom 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/cd87c180b301e8eb7eee916fe6bb97=
2962fe6904

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.
>=20
> Excellent.
>=20
> More to follow later (may be Whitsuntide time though, subject to work =
load until then).
>=20
> Cool. Time for a beer now.
>=20
> Cheers,
>=20
> Peter.
>=20
> ---
>=20
> [root@rpi4 ~]# gpioctl -c 25 OUT
> [root@rpi4 ~]# gpioctl 25 1
> [root@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 =3D =
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=3D0x2<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=3D0x2<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@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@rpi4:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64
>>>> [4] =
https://jamesachambers.com/raspberry-pi-4-bootloader-firmware-updating-rec=
overy-guide/
>>>> [5] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252971
>> [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
>=20

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6386F7D9-2175-4015-8EDA-838C8125AFED>