Skip to content

Commit ffec09c

Browse files
committed
[NOT-FOR-UPSTREAM] Add build instructions
For convenience this also adds a small beaglev_defconfig and the firmware needed for the brcmfmac driver along with the signed regulatory database. The firmware is from the linux-firmware repo and the regulatory database from the wireless-regdb Fedora package. Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Drew Fustini <[email protected]>
1 parent d5a7196 commit ffec09c

File tree

9 files changed

+464
-0
lines changed

9 files changed

+464
-0
lines changed

README.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Linux kernel for the BeagleV Starlight Beta board
2+
3+
## What is this?
4+
5+
The [BeagleV Starlight Beta][beta] board is a Linux-capable 64bit RISC-V
6+
development board using the [StarFive JH7100 SoC][soc]. About 300 was sent out
7+
to developers in April 2021 in preparation for an eventual BeagleV branded
8+
board using the updated JH7110 chip.
9+
The BeagleBoard organization has since [cancelled that project][beaglev], but
10+
instead StarFive has [teamed up with Radxa][radxa] to produce new boards with
11+
the JH7100 later in 2021 and the updated JH7110 is still scheduled to be out in
12+
2022.
13+
14+
This tree is meant to collect all the in-development patches for running Linux on
15+
the JH7100 based boards.
16+
17+
[beta]: https://github.com/beagleboard/beaglev-starlight
18+
[soc]: https://github.com/starfive-tech/StarLight_Docs
19+
[beaglev]: https://beaglev.org/blog/2021-07-30-the-future-of-beaglev-community
20+
[radxa]: https://www.starfivetech.com/en/site/new_details/836
21+
22+
## Cross-compiling
23+
24+
Cross-compiling the Linux kernel is surprisingly easy since it doesn't depend
25+
on any (target) libraries and most distributions already have packages with a
26+
working cross-compiler. We'll also need a few other tools to build everything:
27+
```shell
28+
# Debian/Ubuntu
29+
sudo apt-get install libncurses-dev libssl-dev bc flex bison make gcc gcc-riscv64-linux-gnu
30+
# Fedora
31+
sudo dnf install ncurses-devel openssl openssl-devel bc flex bison make gcc gcc-riscv64-linux-gnu
32+
# Archlinux
33+
sudo pacman -S --needed ncurses openssl bc flex bison make gcc riscv64-linux-gnu-gcc
34+
```
35+
36+
The build system needs to know that we want to cross-compile a kernel for
37+
RISC-V by setting `ARCH=riscv`. It also needs to know the prefix of our
38+
cross-compiler using `CROSS_COMPILE=riscv64-linux-gnu-`. Also let's assume
39+
we're building on an 8-core machine so compilation can be greatly sped up by
40+
telling make to use all 8 cores with `-j8`.
41+
42+
First we need to configure the kernel though. Linux has a *very* extensive
43+
configuration system, but you can get a good baseline configuration for the
44+
board using:
45+
```shell
46+
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- starlight_defconfig
47+
```
48+
49+
There is nothing magic about this configuration other than it has all the
50+
drivers enabled that are working for the hardware on the board. In fact it has
51+
very little extra features enabled which is great for compile times, but you
52+
are very much encouraged to add additional drivers and configure your kernel
53+
further using
54+
```shell
55+
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- nconfig
56+
```
57+
58+
Now compile the whole thing with
59+
```
60+
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
61+
```
62+
63+
64+
## Installing
65+
66+
Once the build has finished the resulting kernel can be found at
67+
```shell
68+
arch/riscv/boot/Image
69+
```
70+
You'll also need the matching device tree at
71+
```shell
72+
arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dtb
73+
```
74+
These two files should be copied to the boot partition on the SD card. That is
75+
onto the same file system that contains the `extlinux/extlinux.conf`. On the
76+
default Fedora image this is mounted at `/boot`.
77+
78+
Now add the following entry to the `extlinux/extlinux.conf` file:
79+
```
80+
label My New Kernel
81+
kernel /Image
82+
fdt /jh7100-beaglev-starlight.dtb
83+
append earlycon console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait stmmac.chain_mode=1
84+
```
85+
86+
This assumes your root file system is at `/dev/mmcblk0p2` which it is on the
87+
default Fedora image. Also if your kernel is very big it might be beneficial to
88+
use the compressed `Image.gz` rather than the uncompressed `Image`.
89+
90+
The `starlight_defconfig` doesn't enable modules, but if you enabled them in
91+
your build you'll also need to install them in `/lib/modules/` on the root file
92+
system. How to do that best is out of scope for this README though.
93+
94+
95+
## Status
96+
97+
#### SoC
98+
99+
- [x] Pinctrl/Pinmux
100+
- [x] GPIO
101+
- [x] Serial port
102+
- [x] I2C
103+
- [x] SPI
104+
- [x] MMC / SDIO / SD card
105+
- [x] Random number generator
106+
- [x] Temperature sensor
107+
- [x] Ethernet, though a little flaky and `stmmac.chain_mode=1` needed on the cmdline
108+
- [x] USB, USB 3.0 is broken with `CONFIG_PM` enabled
109+
- [x] DRM driver
110+
- [x] NVDLA
111+
- [x] Clock tree, WIP clock driver is mostly read-only for now
112+
- [ ] Watchdog
113+
- [ ] Security Engine
114+
- [ ] MIPI-DSI
115+
- [ ] ISP
116+
- [ ] MIPI-CSI
117+
- [ ] Video Decode
118+
- [ ] Video Encode
119+
- [ ] NNE50
120+
- [ ] Vision DSP
121+
122+
#### Board
123+
124+
- [x] LED
125+
- [x] PMIC / Reboot
126+
- [x] Ethernet PHY
127+
- [x] HDMI
128+
- [x] AP6236 Wifi
129+
- [x] AP6236 Bluetooth, with a [userspace tool][patchram]
130+
- [ ] GD25LQ256D SPI flash
131+
132+
[patchram]: https://github.com/AsteroidOS/brcm-patchram-plus
133+
134+
## Contributing
135+
136+
If you're working on cleaning up or upstreaming some of this or adding support
137+
for more of the SoC I'd very much like to incorporate it into this tree. Either
138+
send a pull request, mail or contact Esmil on IRC/Slack.
139+
140+
Also I think of this tree mostly as a collection of patches that will hopefully
141+
mature enough to be submitted upstream. So expect regular rebases.
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
CONFIG_LOCALVERSION="-starlight"
2+
CONFIG_SYSVIPC=y
3+
CONFIG_POSIX_MQUEUE=y
4+
CONFIG_WATCH_QUEUE=y
5+
# CONFIG_CROSS_MEMORY_ATTACH is not set
6+
CONFIG_NO_HZ_IDLE=y
7+
CONFIG_HIGH_RES_TIMERS=y
8+
CONFIG_BPF_SYSCALL=y
9+
CONFIG_PSI=y
10+
# CONFIG_CPU_ISOLATION is not set
11+
CONFIG_IKCONFIG=y
12+
CONFIG_IKCONFIG_PROC=y
13+
CONFIG_CGROUPS=y
14+
CONFIG_CGROUP_SCHED=y
15+
CONFIG_CFS_BANDWIDTH=y
16+
CONFIG_CGROUP_PIDS=y
17+
CONFIG_CGROUP_CPUACCT=y
18+
CONFIG_NAMESPACES=y
19+
CONFIG_BLK_DEV_INITRD=y
20+
# CONFIG_RD_BZIP2 is not set
21+
# CONFIG_RD_LZMA is not set
22+
# CONFIG_RD_XZ is not set
23+
# CONFIG_RD_LZO is not set
24+
# CONFIG_RD_LZ4 is not set
25+
CONFIG_EXPERT=y
26+
# CONFIG_SYSFS_SYSCALL is not set
27+
CONFIG_USERFAULTFD=y
28+
CONFIG_PERF_EVENTS=y
29+
# CONFIG_VM_EVENT_COUNTERS is not set
30+
# CONFIG_SLUB_DEBUG is not set
31+
CONFIG_SHUFFLE_PAGE_ALLOCATOR=y
32+
CONFIG_SOC_STARFIVE_VIC7100=y
33+
CONFIG_SMP=y
34+
CONFIG_NR_CPUS=4
35+
# CONFIG_RISCV_SBI_V01 is not set
36+
CONFIG_JUMP_LABEL=y
37+
# CONFIG_STACKPROTECTOR is not set
38+
# CONFIG_GCC_PLUGINS is not set
39+
CONFIG_BLK_WBT=y
40+
# CONFIG_BLK_DEBUG_FS is not set
41+
CONFIG_PARTITION_ADVANCED=y
42+
# CONFIG_MQ_IOSCHED_DEADLINE is not set
43+
# CONFIG_MQ_IOSCHED_KYBER is not set
44+
CONFIG_IOSCHED_BFQ=y
45+
CONFIG_KSM=y
46+
CONFIG_CMA=y
47+
CONFIG_ZSMALLOC=y
48+
CONFIG_NET=y
49+
CONFIG_PACKET=y
50+
CONFIG_UNIX=y
51+
CONFIG_INET=y
52+
CONFIG_IP_ADVANCED_ROUTER=y
53+
CONFIG_IP_MULTIPLE_TABLES=y
54+
CONFIG_IP_PNP=y
55+
CONFIG_IP_PNP_DHCP=y
56+
# CONFIG_INET_DIAG is not set
57+
# CONFIG_IPV6_SIT is not set
58+
CONFIG_IPV6_MULTIPLE_TABLES=y
59+
CONFIG_NET_SCHED=y
60+
CONFIG_NET_SCH_FQ_CODEL=y
61+
CONFIG_BT=y
62+
CONFIG_BT_RFCOMM=y
63+
CONFIG_BT_RFCOMM_TTY=y
64+
CONFIG_BT_BNEP=y
65+
CONFIG_BT_HIDP=y
66+
CONFIG_BT_HS=y
67+
CONFIG_BT_HCIUART=y
68+
CONFIG_BT_HCIUART_H4=y
69+
CONFIG_CFG80211=y
70+
# CONFIG_CFG80211_DEFAULT_PS is not set
71+
CONFIG_RFKILL=y
72+
CONFIG_DEVTMPFS=y
73+
CONFIG_DEVTMPFS_MOUNT=y
74+
# CONFIG_STANDALONE is not set
75+
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
76+
CONFIG_EXTRA_FIRMWARE="regulatory.db regulatory.db.p7s brcm/brcmfmac43430-sdio.bin brcm/brcmfmac43430-sdio.clm_blob brcm/brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100.txt"
77+
CONFIG_EXTRA_FIRMWARE_DIR="firmware"
78+
CONFIG_MTD=y
79+
CONFIG_MTD_BLOCK=y
80+
CONFIG_MTD_PARTITIONED_MASTER=y
81+
CONFIG_MTD_SPI_NOR=y
82+
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
83+
CONFIG_ZRAM=y
84+
CONFIG_ZRAM_MEMORY_TRACKING=y
85+
CONFIG_BLK_DEV_LOOP=y
86+
CONFIG_BLK_DEV_LOOP_MIN_COUNT=1
87+
CONFIG_BLK_DEV_NBD=y
88+
CONFIG_SCSI=y
89+
# CONFIG_SCSI_PROC_FS is not set
90+
CONFIG_BLK_DEV_SD=y
91+
CONFIG_CHR_DEV_SG=y
92+
CONFIG_SCSI_CONSTANTS=y
93+
CONFIG_SCSI_SCAN_ASYNC=y
94+
# CONFIG_SCSI_LOWLEVEL is not set
95+
CONFIG_NETDEVICES=y
96+
CONFIG_WIREGUARD=y
97+
CONFIG_TUN=y
98+
CONFIG_STMMAC_ETH=y
99+
CONFIG_MICREL_PHY=y
100+
CONFIG_BRCMFMAC=y
101+
CONFIG_INPUT_EVDEV=y
102+
# CONFIG_INPUT_KEYBOARD is not set
103+
# CONFIG_INPUT_MOUSE is not set
104+
# CONFIG_SERIO is not set
105+
# CONFIG_LEGACY_PTYS is not set
106+
# CONFIG_LDISC_AUTOLOAD is not set
107+
CONFIG_SERIAL_8250=y
108+
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
109+
# CONFIG_SERIAL_8250_16550A_VARIANTS is not set
110+
CONFIG_SERIAL_8250_CONSOLE=y
111+
CONFIG_SERIAL_8250_DW=y
112+
# CONFIG_DEVMEM is not set
113+
# CONFIG_I2C_COMPAT is not set
114+
CONFIG_I2C_CHARDEV=y
115+
# CONFIG_I2C_HELPER_AUTO is not set
116+
CONFIG_I2C_DESIGNWARE_PLATFORM=y
117+
CONFIG_SPI=y
118+
CONFIG_SPI_CADENCE_QUADSPI=y
119+
CONFIG_SPI_DESIGNWARE=y
120+
CONFIG_SPI_DW_DMA=y
121+
CONFIG_SPI_DW_MMIO=y
122+
CONFIG_SPI_SPIDEV=y
123+
# CONFIG_PTP_1588_CLOCK is not set
124+
CONFIG_GPIOLIB_FASTPATH_LIMIT=256
125+
CONFIG_GPIO_SYSFS=y
126+
CONFIG_GPIO_TPS65086=y
127+
CONFIG_POWER_RESET=y
128+
CONFIG_POWER_RESET_TPS65086=y
129+
CONFIG_SENSORS_SFCTEMP=y
130+
CONFIG_THERMAL=y
131+
CONFIG_THERMAL_NETLINK=y
132+
CONFIG_THERMAL_STATISTICS=y
133+
CONFIG_THERMAL_WRITABLE_TRIPS=y
134+
CONFIG_CPU_THERMAL=y
135+
CONFIG_MFD_TPS65086=y
136+
CONFIG_DRM=y
137+
CONFIG_DRM_I2C_NXP_TDA998X=y
138+
CONFIG_DRM_STARFIVE=y
139+
CONFIG_FB=y
140+
# CONFIG_VGA_CONSOLE is not set
141+
CONFIG_FRAMEBUFFER_CONSOLE=y
142+
CONFIG_USB=y
143+
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
144+
CONFIG_USB_MON=y
145+
CONFIG_USB_XHCI_HCD=y
146+
CONFIG_USB_XHCI_DBGCAP=y
147+
CONFIG_USB_STORAGE=y
148+
CONFIG_USB_UAS=y
149+
CONFIG_USB_CDNS_SUPPORT=y
150+
CONFIG_USB_CDNS3=y
151+
CONFIG_USB_CDNS3_HOST=y
152+
CONFIG_MMC=y
153+
# CONFIG_PWRSEQ_EMMC is not set
154+
CONFIG_MMC_DW=y
155+
CONFIG_NEW_LEDS=y
156+
CONFIG_LEDS_CLASS=y
157+
CONFIG_LEDS_GPIO=y
158+
CONFIG_LEDS_TRIGGERS=y
159+
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
160+
CONFIG_DMADEVICES=y
161+
CONFIG_DW_AXI_DMAC=y
162+
CONFIG_DMABUF_HEAPS=y
163+
CONFIG_DMABUF_HEAPS_SYSTEM=y
164+
# CONFIG_VIRTIO_MENU is not set
165+
# CONFIG_VHOST_MENU is not set
166+
# CONFIG_IOMMU_SUPPORT is not set
167+
CONFIG_PWM=y
168+
CONFIG_PWM_SIFIVE_PTC=y
169+
CONFIG_EXT4_FS=y
170+
CONFIG_EXT4_FS_POSIX_ACL=y
171+
CONFIG_EXT4_FS_SECURITY=y
172+
CONFIG_BTRFS_FS=y
173+
CONFIG_BTRFS_FS_POSIX_ACL=y
174+
# CONFIG_MANDATORY_FILE_LOCKING is not set
175+
# CONFIG_DNOTIFY is not set
176+
CONFIG_FANOTIFY=y
177+
CONFIG_AUTOFS_FS=y
178+
CONFIG_VFAT_FS=y
179+
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15"
180+
CONFIG_FAT_DEFAULT_UTF8=y
181+
CONFIG_EXFAT_FS=y
182+
CONFIG_PROC_KCORE=y
183+
CONFIG_TMPFS=y
184+
CONFIG_TMPFS_POSIX_ACL=y
185+
# CONFIG_MISC_FILESYSTEMS is not set
186+
CONFIG_NFS_FS=y
187+
CONFIG_ROOT_NFS=y
188+
CONFIG_NLS_DEFAULT="utf8"
189+
CONFIG_NLS_CODEPAGE_437=y
190+
CONFIG_NLS_ISO8859_15=y
191+
CONFIG_NLS_UTF8=y
192+
CONFIG_LSM=""
193+
CONFIG_CRYPTO_ZSTD=y
194+
# CONFIG_CRYPTO_HW is not set
195+
# CONFIG_RAID6_PQ_BENCHMARK is not set
196+
CONFIG_DMA_CMA=y
197+
# CONFIG_SYMBOLIC_ERRNAME is not set
198+
CONFIG_STRIP_ASM_SYMS=y
199+
# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
200+
CONFIG_DEBUG_FS=y
201+
# CONFIG_DEBUG_MISC is not set
202+
CONFIG_DEBUG_RODATA_TEST=y
203+
CONFIG_DEBUG_WX=y
204+
CONFIG_SOFTLOCKUP_DETECTOR=y
205+
CONFIG_WQ_WATCHDOG=y
206+
# CONFIG_SCHED_DEBUG is not set
207+
CONFIG_STACKTRACE=y
208+
CONFIG_RCU_CPU_STALL_TIMEOUT=60
209+
# CONFIG_RCU_TRACE is not set
210+
# CONFIG_FTRACE is not set
211+
# CONFIG_RUNTIME_TESTING_MENU is not set
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-License-Identifier: GPL-2.0+
2+
# (C) Copyright 2018 Linaro Ltd
3+
# NVRAM config file for the Ampak AP6212 43430 WiFi/BT module
4+
aa2g=1
5+
ag0=255
6+
AvVmid_c0=0x0,0xc8
7+
boardflags=0x00404201
8+
# boardflags3 is not set
9+
boardnum=22
10+
boardrev=0x1101
11+
boardtype=0x0726
12+
# btc_params is not set
13+
cckbw202gpo=0x5555
14+
cckpwroffset0=5
15+
ccode=ALL
16+
# cldo_pwm is not set
17+
deadman_to=0xffffffff
18+
devid=0x43e2
19+
extpagain2g=0
20+
il0macaddr=00:90:4c:c5:12:38
21+
legofdmbw202gpo=0x77777777
22+
macaddr=00:90:4c:c5:12:38
23+
manfid=0x2d0
24+
maxp2ga0=90
25+
mcsbw202gpo=0xaaaaaaaa
26+
muxenab=0x10
27+
nocrc=1
28+
ofdmdigfilttype=7
29+
# ofdmdigfilttypebe is not set
30+
pa0itssit=0x20
31+
pa2ga0=-168,7161,-820
32+
# pacalidx2g is not set
33+
# papdendidx is not set
34+
# papdepsoffset is not set
35+
papdmode=2
36+
# papdvalidtest is not set
37+
prodid=0x0726
38+
# propbw202gpois not set
39+
# spurconfig is not set
40+
sromrev=11
41+
txpwrbckof=6
42+
vendid=0x14e4
43+
wl0id=0x431b
44+
xtalfreq=26000

0 commit comments

Comments
 (0)