Unable to enable ATAGS on RPI4

Open
#1,478 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
raspberry-pi
Domain
embedded-iot

Research direction

Start by reproducing the behavior with the documented config.txt contents and a previously working kernel8.img, then compare booting with device_tree= present, absent, and with the *.dtb files removed. Check the firmware files listed in the SD-card layout and establish whether ATAGS is supported in this configuration. Done means the ATAGS setting either boots the kernel as expected or its limitation and required configuration are clearly identified.

Written by the indexing model from the issue text.

Description

Hi, I'm new to bare-metal programming and trying to write a toy OS with bare-metal RPI 4B. I noticed that Raspberry Pi by default is currently using Device Tree instead of ATAGS. Therefore, I tried several ways to enable ATAGS, but they make my kernel8.img unable to run. Details below.

I tried both add device_tree= to the config.txt and remove all the .dtb files under the directory. But after these, my kernel8.img no longer make any observable side effects (repeatedly set/clear GPIO pins, interact through UART, etc.) that are supposed to be made. I can see there are no error-indicating LED flashes.

steps to reproduce (for me):

  • download the most up-to-date firmware (commit f0eab3a24 at Mon Sep 28 15:29:59 2020 +0100)
  • copy all the files under boot/ besides *.img to the mounted SD card reader, copy an arbitrary previously working kernel8.img to the mounted SD card reader.
  • use the following config.txt
arm_control=0x200
kernel_address=0x80000
enable_uart=1
core_freq=250
device_tree=
  • insert the SD card to RPI, start the pi.

expected:

kernel8.img is working as expected.

actual:

kernel8.img is not working. There are no led flashes. After deleting device_tree= from config.txt. Things are working as expected.

notes

Besides adding device_tree=, removing all the *.dtb files have the same unexpected behavior.

My SD card partition with booting information:

/mnt/sdcard$ ls
bootcode.bin   config.txt~   fixup4db.dat  fixup.dat     fixup_x.dat   start4cd.elf  start4x.elf   start.elf
bootcode.bin~  fixup4cd.dat  fixup4x.dat   fixup.dat~    kernel8.img   start4db.elf  start_cd.elf  start.elf~
config.txt     fixup4.dat    fixup_cd.dat  fixup_db.dat  kernel8.img~  start4.elf    start_db.elf  start_x.elf

Let me know if there's any further information I could provide or any solutions I can take. Please advise if there's a better place to put it.

Dominant language
No language data
Stars
5.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/firmware

All issues in raspberrypi/firmware

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.