Skip to content

Commit d6cc5db

Browse files
committed
[Not for upstream] Add build instructions
For convenience this also adds a small starlight_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]>
1 parent 6e5931d commit d6cc5db

9 files changed

+450
-0
lines changed

README.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Linux kernel for the BeagleV Starlight
2+
3+
## What is this?
4+
5+
The [BeagleV Starlight][bborg] board is a new Linux-capable 64bit RISC-V
6+
development board. It has not shipped yet, but [beta versions][beta] are out to
7+
developers. Consequently the board is not yet supported by upstream Linux. This
8+
tree is meant to collect all the in-development patches for running Linux on
9+
the board.
10+
11+
[bborg]: https://beagleboard.org/beaglev
12+
[beta]: https://github.com/beagleboard/beaglev-starlight
13+
14+
## Cross-compiling
15+
16+
Cross-compiling the Linux kernel is surprisingly easy since it doesn't depend
17+
on any (target) libraries and most distributions already have packages with a
18+
working cross-compiler. We'll also need a few other tools to build everything:
19+
```shell
20+
# Debian/Ubuntu
21+
sudo apt-get install libncurses-dev libssl-dev bc flex bison make gcc gcc-riscv64-linux-gnu
22+
# Fedora
23+
sudo dnf install ncurses-devel openssl openssl-devel bc flex bison make gcc gcc-riscv64-linux-gnu
24+
# Archlinux
25+
sudo pacman -S --needed ncurses openssl bc flex bison make gcc riscv64-linux-gnu-gcc
26+
```
27+
28+
The build system needs to know that we want to cross-compile a kernel for
29+
RISC-V by setting `ARCH=riscv`. It also needs to know the prefix of our
30+
cross-compiler using `CROSS_COMPILE=riscv64-linux-gnu-`. Also let's assume
31+
we're building on an 8-core machine so compilation can be greatly sped up by
32+
telling make to use all 8 cores with `-j8`.
33+
34+
First we need to configure the kernel though. Linux has a *very* extensive
35+
configuration system, but you can get a good baseline configuration for the
36+
board using:
37+
```shell
38+
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- starlight_defconfig
39+
```
40+
41+
There is nothing magic about this configuration other than it has all the
42+
drivers enabled that are working for the hardware on the board. In fact it has
43+
very little extra features enabled which is great for compile times, but you
44+
are very much encouraged to add additional drivers and configure your kernel
45+
further using
46+
```shell
47+
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- nconfig
48+
```
49+
50+
Now compile the whole thing with
51+
```
52+
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
53+
```
54+
55+
56+
## Installing
57+
58+
Once the build has finished the resulting kernel can be found at
59+
```shell
60+
arch/riscv/boot/Image
61+
```
62+
You'll also need the matching device tree at
63+
```shell
64+
arch/riscv/boot/dts/starfive/jh7100-starlight.dtb
65+
```
66+
These two files should be copied to the boot partition on the SD card. That is
67+
onto the same file system that contains the `extlinux/extlinux.conf`. On the
68+
default Fedora image this is mounted at `/boot`.
69+
70+
Now add the following entry to the `extlinux/extlinux.conf` file:
71+
```
72+
label My New Kernel
73+
kernel /Image
74+
fdt /jh7100-starlight.dtb
75+
append earlycon console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait stmmac.chain_mode=1
76+
```
77+
78+
This assumes your root file system is at `/dev/mmcblk0p2` which it is on the
79+
default Fedora image. Also if your kernel is very big it might be beneficial to
80+
use the compressed `Image.gz` rather than the uncompressed `Image`.
81+
82+
The `starlight_defconfig` doesn't enable modules, but if you enabled them in
83+
your build you'll also need to install them in `/lib/modules/` on the root file
84+
system. How to do that best is out of scope for this README though.
85+
86+
87+
## Status
88+
89+
#### SoC
90+
91+
- [x] GPIO
92+
- [x] Serial port
93+
- [x] I2C
94+
- [x] SPI
95+
- [x] MMC / SDIO / SD card
96+
- [x] Random number generator
97+
- [x] Temperature sensor
98+
- [x] Ethernet, though a little flaky and `stmmac.chain_mode=1` needed on the cmdline
99+
- [x] Framebuffer, fbdev driver so not upstreamable
100+
- [ ] Clock tree, statically set up by u-boot
101+
- [ ] Pinctrl/Pinmux, statically set up by u-boot
102+
- [ ] Watchdog
103+
- [ ] USB, USB 2.0 seems to work ok, but USB 3.0 is very flaky / broken
104+
- [ ] Security Engine
105+
- [ ] MIPI-DSI
106+
- [ ] ISP
107+
- [ ] MIPI-CSI
108+
- [ ] Video Decode
109+
- [ ] Video Encode
110+
- [ ] NVDLA
111+
- [ ] NNE50
112+
- [ ] Vision DSP
113+
114+
#### Board
115+
116+
- [x] LED
117+
- [x] PMIC / Reboot
118+
- [x] Ethernet PHY
119+
- [x] HDMI, working with [some screens][hdmi]
120+
- [x] AP6236 Wifi
121+
- [ ] AP6236 Bluetooth
122+
- [ ] GD25LQ256D SPI flash
123+
124+
[hdmi]: https://forum.beagleboard.org/t/hdmi-displays-compatible-list/
125+
126+
## Contributing
127+
128+
If you're working on cleaning up or upstreaming some of this or adding support
129+
for more of the SoC I'd very much like to incorporate it into this tree. Either
130+
send a pull request, mail or contact Esmil on IRC/Slack.
131+
132+
Also I think of this tree mostly as a collection of patches that will hopefully
133+
mature enough to be submitted upstream. So expect regular rebases.
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
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_PSI=y
9+
# CONFIG_CPU_ISOLATION is not set
10+
CONFIG_IKCONFIG=y
11+
CONFIG_IKCONFIG_PROC=y
12+
CONFIG_CGROUPS=y
13+
CONFIG_CGROUP_SCHED=y
14+
CONFIG_CFS_BANDWIDTH=y
15+
CONFIG_CGROUP_PIDS=y
16+
CONFIG_CGROUP_CPUACCT=y
17+
CONFIG_NAMESPACES=y
18+
CONFIG_BLK_DEV_INITRD=y
19+
# CONFIG_RD_BZIP2 is not set
20+
# CONFIG_RD_LZMA is not set
21+
# CONFIG_RD_XZ is not set
22+
# CONFIG_RD_LZO is not set
23+
# CONFIG_RD_LZ4 is not set
24+
CONFIG_EXPERT=y
25+
# CONFIG_SYSFS_SYSCALL is not set
26+
CONFIG_BPF_SYSCALL=y
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_PM=y
37+
CONFIG_JUMP_LABEL=y
38+
# CONFIG_STACKPROTECTOR is not set
39+
# CONFIG_GCC_PLUGINS is not set
40+
CONFIG_BLK_WBT=y
41+
# CONFIG_BLK_DEBUG_FS is not set
42+
CONFIG_PARTITION_ADVANCED=y
43+
# CONFIG_MQ_IOSCHED_DEADLINE is not set
44+
# CONFIG_MQ_IOSCHED_KYBER is not set
45+
CONFIG_IOSCHED_BFQ=y
46+
CONFIG_KSM=y
47+
CONFIG_CMA=y
48+
CONFIG_ZSMALLOC=y
49+
CONFIG_NET=y
50+
CONFIG_PACKET=y
51+
CONFIG_UNIX=y
52+
CONFIG_INET=y
53+
CONFIG_IP_ADVANCED_ROUTER=y
54+
CONFIG_IP_MULTIPLE_TABLES=y
55+
CONFIG_IP_PNP=y
56+
CONFIG_IP_PNP_DHCP=y
57+
# CONFIG_INET_DIAG is not set
58+
# CONFIG_IPV6_SIT is not set
59+
CONFIG_IPV6_MULTIPLE_TABLES=y
60+
CONFIG_NET_SCHED=y
61+
CONFIG_NET_SCH_FQ_CODEL=y
62+
CONFIG_CFG80211=y
63+
# CONFIG_CFG80211_DEFAULT_PS is not set
64+
CONFIG_RFKILL=y
65+
CONFIG_DEVTMPFS=y
66+
CONFIG_DEVTMPFS_MOUNT=y
67+
# CONFIG_STANDALONE is not set
68+
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
69+
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"
70+
CONFIG_EXTRA_FIRMWARE_DIR="firmware"
71+
CONFIG_MTD=y
72+
CONFIG_MTD_BLOCK=y
73+
CONFIG_MTD_PARTITIONED_MASTER=y
74+
CONFIG_MTD_SPI_NOR=y
75+
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
76+
CONFIG_ZRAM=y
77+
CONFIG_ZRAM_MEMORY_TRACKING=y
78+
CONFIG_BLK_DEV_LOOP=y
79+
CONFIG_BLK_DEV_LOOP_MIN_COUNT=1
80+
CONFIG_BLK_DEV_NBD=y
81+
CONFIG_SCSI=y
82+
# CONFIG_SCSI_PROC_FS is not set
83+
CONFIG_BLK_DEV_SD=y
84+
CONFIG_CHR_DEV_SG=y
85+
CONFIG_SCSI_CONSTANTS=y
86+
CONFIG_SCSI_SCAN_ASYNC=y
87+
# CONFIG_SCSI_LOWLEVEL is not set
88+
CONFIG_NETDEVICES=y
89+
CONFIG_WIREGUARD=y
90+
CONFIG_TUN=y
91+
CONFIG_STMMAC_ETH=y
92+
CONFIG_MICREL_PHY=y
93+
CONFIG_BRCMFMAC=y
94+
CONFIG_INPUT_EVDEV=y
95+
# CONFIG_INPUT_KEYBOARD is not set
96+
# CONFIG_INPUT_MOUSE is not set
97+
# CONFIG_SERIO is not set
98+
# CONFIG_LEGACY_PTYS is not set
99+
# CONFIG_LDISC_AUTOLOAD is not set
100+
CONFIG_SERIAL_8250=y
101+
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
102+
# CONFIG_SERIAL_8250_16550A_VARIANTS is not set
103+
CONFIG_SERIAL_8250_CONSOLE=y
104+
CONFIG_SERIAL_8250_DW=y
105+
# CONFIG_DEVMEM is not set
106+
# CONFIG_I2C_COMPAT is not set
107+
CONFIG_I2C_CHARDEV=y
108+
# CONFIG_I2C_HELPER_AUTO is not set
109+
CONFIG_I2C_DESIGNWARE_PLATFORM=y
110+
CONFIG_SPI=y
111+
CONFIG_SPI_CADENCE_QUADSPI=y
112+
CONFIG_SPI_DESIGNWARE=y
113+
CONFIG_SPI_DW_DMA=y
114+
CONFIG_SPI_DW_MMIO=y
115+
CONFIG_SPI_SPIDEV=y
116+
# CONFIG_PTP_1588_CLOCK is not set
117+
CONFIG_GPIOLIB=y
118+
CONFIG_GPIOLIB_FASTPATH_LIMIT=256
119+
CONFIG_GPIO_SYSFS=y
120+
# CONFIG_GPIO_CDEV_V1 is not set
121+
CONFIG_GPIO_TPS65086=y
122+
CONFIG_POWER_RESET=y
123+
CONFIG_POWER_RESET_TPS65086=y
124+
CONFIG_SENSORS_SFCTEMP=y
125+
CONFIG_THERMAL=y
126+
CONFIG_THERMAL_NETLINK=y
127+
CONFIG_THERMAL_STATISTICS=y
128+
CONFIG_THERMAL_WRITABLE_TRIPS=y
129+
CONFIG_CPU_THERMAL=y
130+
CONFIG_MFD_TPS65086=y
131+
CONFIG_DRM=y
132+
CONFIG_FB_STARFIVE=y
133+
CONFIG_FB_STARFIVE_HDMI_TDA998X=y
134+
# CONFIG_VGA_CONSOLE is not set
135+
CONFIG_FRAMEBUFFER_CONSOLE=y
136+
CONFIG_USB=y
137+
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
138+
CONFIG_USB_MON=y
139+
CONFIG_USB_XHCI_HCD=y
140+
CONFIG_USB_XHCI_DBGCAP=y
141+
CONFIG_USB_STORAGE=y
142+
CONFIG_USB_UAS=y
143+
CONFIG_USB_CDNS_SUPPORT=y
144+
CONFIG_USB_CDNS3=y
145+
CONFIG_USB_CDNS3_HOST=y
146+
CONFIG_MMC=y
147+
# CONFIG_PWRSEQ_EMMC is not set
148+
CONFIG_MMC_DW=y
149+
CONFIG_NEW_LEDS=y
150+
CONFIG_LEDS_CLASS=y
151+
CONFIG_LEDS_GPIO=y
152+
CONFIG_LEDS_TRIGGERS=y
153+
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
154+
CONFIG_DMADEVICES=y
155+
CONFIG_DW_AXI_DMAC=y
156+
CONFIG_DMABUF_HEAPS=y
157+
CONFIG_DMABUF_HEAPS_SYSTEM=y
158+
# CONFIG_VIRTIO_MENU is not set
159+
# CONFIG_VHOST_MENU is not set
160+
# CONFIG_IOMMU_SUPPORT is not set
161+
CONFIG_PWM=y
162+
CONFIG_PWM_SIFIVE_PTC=y
163+
CONFIG_EXT4_FS=y
164+
CONFIG_EXT4_FS_POSIX_ACL=y
165+
CONFIG_EXT4_FS_SECURITY=y
166+
CONFIG_BTRFS_FS=y
167+
CONFIG_BTRFS_FS_POSIX_ACL=y
168+
# CONFIG_MANDATORY_FILE_LOCKING is not set
169+
# CONFIG_DNOTIFY is not set
170+
CONFIG_FANOTIFY=y
171+
CONFIG_AUTOFS_FS=y
172+
CONFIG_VFAT_FS=y
173+
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15"
174+
CONFIG_FAT_DEFAULT_UTF8=y
175+
CONFIG_EXFAT_FS=y
176+
CONFIG_PROC_KCORE=y
177+
CONFIG_TMPFS=y
178+
CONFIG_TMPFS_POSIX_ACL=y
179+
# CONFIG_MISC_FILESYSTEMS is not set
180+
CONFIG_NFS_FS=y
181+
CONFIG_ROOT_NFS=y
182+
CONFIG_NLS_DEFAULT="utf8"
183+
CONFIG_NLS_CODEPAGE_437=y
184+
CONFIG_NLS_ISO8859_15=y
185+
CONFIG_NLS_UTF8=y
186+
CONFIG_LSM=""
187+
CONFIG_CRYPTO_ZSTD=y
188+
# CONFIG_CRYPTO_HW is not set
189+
# CONFIG_RAID6_PQ_BENCHMARK is not set
190+
CONFIG_DMA_CMA=y
191+
# CONFIG_SYMBOLIC_ERRNAME is not set
192+
CONFIG_STRIP_ASM_SYMS=y
193+
# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
194+
CONFIG_DEBUG_FS=y
195+
# CONFIG_DEBUG_MISC is not set
196+
CONFIG_DEBUG_RODATA_TEST=y
197+
CONFIG_DEBUG_WX=y
198+
CONFIG_SOFTLOCKUP_DETECTOR=y
199+
CONFIG_WQ_WATCHDOG=y
200+
# CONFIG_SCHED_DEBUG is not set
201+
CONFIG_STACKTRACE=y
202+
CONFIG_RCU_CPU_STALL_TIMEOUT=60
203+
# CONFIG_RCU_TRACE is not set
204+
# CONFIG_FTRACE is not set
205+
# 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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
brcmfmac43430-sdio.AP6212.txt

firmware/brcm/brcmfmac43430-sdio.bin

411 KB
Binary file not shown.
4.62 KB
Binary file not shown.

0 commit comments

Comments
 (0)