Skip to content

Instantly share code, notes, and snippets.

View pamolloy's full-sized avatar

Philip Molloy pamolloy

View GitHub Profile
U-Boot TPL 2020.07 (Jul 20 2021 - 21:07:08)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
@pamolloy
pamolloy / zynqmp-fpga-build-error.txt
Created December 24, 2019 17:52
Error building zynqmp-fpga.c as a module
>>> linux foo-2019.02.26 Building
...
PATH="..." BR_BINARIES_DIR=/home/philip/repos/third-party/buildroot/output/images KBUILD_BUILD_VERSION=1 KBUILD_BUILD_USER=buildroot KBUILD_BUILD_HOST=buildroot KBUILD_BUILD_TIMESTAMP="Tue Jul 9 10:59:29 EDT 2019" KCFLAGS=-Wno-attribute-alias /usr/bin/make -j9 HOSTCC="/home/philip/repos/third-party/buildroot/output/per-package/linux/host/bin/ccache /usr/lib64/ccache/gcc -O2 -I/home/philip/repos/third-party/buildroot/output/per-package/linux/host/include -L/home/philip/repos/third-party/buildroot/output/per-package/linux/host/lib -Wl,-rpath,/home/philip/repos/third-party/buildroot/output/per-package/linux/host/lib" ARCH=arm64 INSTALL_MOD_PATH=/home/philip/repos/third-party/buildroot/output/per-package/linux/target CROSS_COMPILE="/home/philip/repos/third-party/buildroot/output/per-package/linux/host/bin/aarch64-linux-gnu-" DEPMOD=/home/philip/repos/third-party/buildroot/output/per-package/linux/host/sbin/depmod INSTALL_MOD_STRIP=1 -C /home/philip/repos/third-party/buildroo
@pamolloy
pamolloy / README.md
Last active December 5, 2019 22:24
Debug installing Fedora with RAID partitions

I'm trying to install Fedora onto a pair of 250GB hard drives with either RAID0 or RAID1.

Debug logging

The issue seems to be the following from journal.txt:

Dec 05 21:27:51 server anaconda[1647]: program: Installing for i386-pc platform.
Dec 05 21:27:51 server anaconda[1647]: program: grub2-install: warning: ../grub-core/partmap/gpt.c:190:this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
Dec 05 21:27:51 server anaconda[1647]: program: grub2-install: error: embedding is not possible, but this is required for RAID and LVM install.
@pamolloy
pamolloy / README.md
Last active November 24, 2019 18:45
Boot into Linux on a Chromebook

The best resource for Chrome hardware is https://mrchromebox.tech/#devmode.

It seems like getting to a shell in order to install alternate firmware requires having ChromeOS installed. It is possible to create USB flash installation media using the following script and list of devices:

I didn't trust running the script with super user privileges so I ran dd manually as follows:

@pamolloy
pamolloy / install-tftp.bash
Created November 21, 2019 15:38
Install a simple FTP server on Fedora
#!/usr/bin/env bash
#
# See https://fedoramagazine.org/how-to-set-up-a-tftp-server-on-fedora/
sudo dnf install tftp-server
sudo systemctl enable tftp
sudo systemctl start tftp
sudo firewall-cmd --add-service=tftp --perm
FILE(GLOB PUBLIC_HEADERS ../include/*.h)
FILE(GLOB PUBLIC_COMMON_HEADERS ../include/common/*.h)
FILE(GLOB PUBLIC_MESSAGES_HEADERS ../include/messages/*.h)
add_library(foo STATIC ...)
set_property(TARGET foo APPEND PROPERTY PUBLIC_HEADER "${PUBLIC_HEADERS}")
set_property(TARGET foo APPEND PROPERTY PUBLIC_HEADER "${PUBLIC_COMMON_HEADERS}")
set_property(TARGET foo APPEND PROPERTY PUBLIC_HEADER "${PUBLIC_MESSAGES_HEADERS}")
@pamolloy
pamolloy / 0001-Load-a-redundant-environment-from-EEPROM.patch
Created August 29, 2019 01:09
U-Boot patch to load a redundant environment from EEPROM
From e95f003a96096f7d8602ad2edaf1dd0bf4e27c45 Mon Sep 17 00:00:00 2001
From: Philip Molloy <philip@philipmolloy.com>
Date: Wed, 28 Aug 2019 21:05:11 -0400
Subject: [PATCH] Load a redundant environment from EEPROM
---
env/eeprom.c | 128 +++++++++++++--------------------------------------
1 file changed, 31 insertions(+), 97 deletions(-)
diff --git a/env/eeprom.c b/env/eeprom.c
@pamolloy
pamolloy / 0001-env-Exit-tools-when-invalid-CRC-found.patch
Last active August 27, 2019 22:12
U-Boot patch to exit userspace tools when an invalid CRC is found
From 6482180e602c4853e43d5c5a40b3349b63aba276 Mon Sep 17 00:00:00 2001
From: Philip Molloy <philip-molloy@idexx.com>
Date: Tue, 2 Apr 2019 17:02:48 -0400
Subject: [PATCH 1/1] env: Exit tools when invalid CRC found
fw_setenv and fw_printenv currently print a warning and use a default
environment compiled into the binary when an invalid CRC is found. This
modifies the default behavior to print an error and exit. This is
especially important when calling the tools from a script since the
script depends on the exit code of the tool to know something went
@pamolloy
pamolloy / install-aerc.bash
Last active December 27, 2019 14:02
Install the aerc e-mail client on Fedora and connect to ProtonMail
#!/usr/bin/env bash
sudo dnf install -y glibc-static
git clone https://git.sr.ht/~sircmpwn/scdoc
cd scdoc
make PREFIX=~/.local/ install
cd ..
sudo dnf install -y golang notmuch-devel
go get golang.org/dl/go1.12.8
@pamolloy
pamolloy / README.md
Last active February 26, 2019 15:28
Enabling EEPROM support in U-Boot

Selecting CONFIG_SYS_I2C_ZYNQ and CONFIG_ZYNQ_I2C0 builds successfully (see Xilinx documentation). But those are old config options and should be replaced with CONFIG_I2C_CADENCE.

Selecting CONFIG_ENV_IS_IN_EEPROM causes the following assertion to fail:

cmd/eeprom.c:58:2: error: #error CONFIG_SYS_I2C_EEPROM_ADDR_LEN must be 1 or 2
 #error CONFIG_SYS_I2C_EEPROM_ADDR_LEN must be 1 or 2
  ^~~~~

...