LS1028a - fix for gpioset during boot; 3.5" HDD mod

I re-installed the LS1028A module in my reform and noticed that USB was broken again during boot. I had installed a fresh Debian unstable image to a SD card.

Turns out that the reform-hw-setup script was failing because gpioset is used in the reform-hw-setup script and that tool has changed behaviour in recent releases.

Previously the chip name was the implicit first parameter and the default mode operation was to change the state and exit. Now the chip has to be set explicitly with the -c flag and the tool keeps running while a certain state is set and will unassert the state on exit.

Diff:

$ diff -u reform-hw-setup*
--- reform-hw-setup	2025-05-19 08:56:43.033026307 +0200
+++ reform-hw-setup-mod	2025-05-19 09:07:16.647020433 +0200
@@ -153,13 +153,14 @@
   "MNT Reform 2 with LS1028A Module")
     # Workaround for a DWC3 USB Controller regression

-    # Assert USB hub reset
-    gpioset 2 13=0
+    # Assert USB hub reset while gpioset command is running.
+    gpioset -c 2 -l 13=active &
+    GPIOSET_PID=$!
     # Reload DWC3 module
     rmmod dwc3
     modprobe dwc3
-    # Deassert USB hub reset
-    gpioset 2 13=1
+    # Deassert USB hub reset by stopping gpioset command.
+    kill $GPIOSET_PID

     # Select "ondemand" CPU frequency scaling governor
     echo ondemand >/sys/devices/system/cpu/cpufreq/policy0/scaling_governor

I’ll send a patch once my account on source.mnt.re is approved.

Note: This does not reliably enable USB during boot, but it seems to work more than half the time. My reform also does not seem to reliably shut down, but I haven’t debugged this yet.

Since the LS1028A has SATA on the M.2 port, I got myself a board to break out a SATA connector (NGFF1ST-N02) and soldered cables to C125 (30V) and C65 (GND) for power (MB rev 2.0, the ibom was very helpful).

Power connects via a JST RCY connector to a first DC-DC converter board which drops 30V to ~16V. I used further DC-DC converters for 5V and 12V and an old Molex to SATA converter cable to actually power the HDD. Along with a normal SATA cable snaking out the side of the reform, this works well for powering a 3.5" HDD with the battery monitor showing about half an Amp of power usage. A 3D printed harness keeps things in place, but the setup is unlikely to be EMI compliant.

Edit: The first voltage converter is required because the other converters I used have a maximum of 28V input voltage.

(This replaces a similar setup with an old laptop mainboard where I tapped into the 19V input power.)

Soldering to the reform is very difficult, likely due to large power/ground planes acting as heat sinks. I don’t have a rework station to heat the full board to 150°C, fortunately soldering to small capacitors worked. I wonder if a hot air soldering gun would also work to heat up the board to sufficient temperature before trying to use a soldering iron.

2 Likes

Aounds like a very cool project.

Good to see some one continuing to use the la1028a. I definitely plan on bringing mine back into rotation, just as soon as I can get my hands on a new motherboard for my other reform.

Do you happen to know if display out is working again? It wasn’t or rather it only worked with older kernels last time I tried.

Would you mind posting some pictures of your set-up? Would love to see it.

Indeed, that change in gpioset broke a number of scripts… :confused:

When spawning a background process, you can run that process under setpriv --pdeathsig TERM which will make sure that the process does get cleaned up even when the parent script should exit before.

Is the username for the https://source.mnt.re/ also johkra? Then i can ping minute on irc to maybe get it approved faster.

Unfortunately, my own LS1028A is still in repair so I cannot test your change but it looks okay and I’ll merge it once you get your account activated. :slight_smile:

The internal display works fine with a 6.14 kernel and without a Wifi card installed. I did have issues a few months ago when I tried with a Wifi card. To state the obvious: The HDMI connector doesn’t work with the LS1028a (has PCIe routed instead of video signals).

Bottom view (taping the power cable to the SD card slot works, but the setup affixing the SATA cable needs more work):

Here’s the reform with the disk on the side. The addition of a third DC-DC converter made my existing 3D printed holder no longer work, so I taped it on a piece of cardboard on top of the disk.

josch: Thanks for the hint with setpriv! Yes, I registered with the user name johkra on gitlab.

2 Likes

My account got approved and I prepared

When I tested yesterday I still had USB failures, but today I rebooted 10 times and USB came up OK every time.

Unfortunately today is the last day with physical access to my reform for a while, let’s see if get to investigate any of following issues:

  1. Reboot/poweroff in tuigreet doesn’t work since it hard codes the shutdown command, the sysv compability scripts are in /sbin in Debian and /sbin is not in PATH by default on Debian.
  2. The reform doesn’t seem to be able to power multiple 2.5" USB hard drives. I want to check the USB hub chip and the 5V power converter for any limitations.
  3. The reform doesn’t power off or reboot. It gets stuck at a state with the screen being off and keyboard backlight still being on. I need to use the circle menu to turn off power. I want to connect a serial terminal to see if I get any messages.

Thank you for your pictures! I love to see how people mod their machines. :slight_smile:

Thank you, merged.

Another issue is, that the greeter gets started as the greetd user which might not have permission to poweroff the machine.

That is a known limitation which should’ve been fixed with motherboard revision 3.0

That is also known and needs somebody to investigate what is going on with the LPC communication on LS1028A. I think there was something in the IRC logs. I can try to find it later…

I found the relevant IRC conversation that I had in mind: 2024-09-10.log

@amospalla did you end up filing the bug? I cannot find it.

Hi, yes, I filled this bug Allow user to poweroff/reboot from greetd/tuigreet (#20) · Issues · Reform / MNT Reform Setup Wizard · GitLab .

1 Like