Page 1 of 1

RPi bare bones: What's RPi-specific and what's not?

Posted: Sat Mar 12, 2016 9:08 am
by Roman
Greetings, everyone.

I'm tinkering with Rust as a kernel development language for Raspberry Pi. I want my project to be organized in a way where target-specific components all live in their specific directories (just like in, for example, Linux). Concretely, architecture-dependent code is in src/arches/$(ARCH) and board-specific is in src/arches/$(ARCH)/plat/$(PLAT) (e.g. src/arches/arm/plat/bcm283x is for Raspberry Pi).

Currently I'm porting the bare bones tutorial, but I'm not sure what is specific to Raspberry Pi and what's not. As I understand, the peripherals offset (0x20200000) is specific to the SoC. But is the GPIO offset (peripherals + 0x200000) specific to the SoC? What about other offsets and the uart_* functions?

Re: RPi bare bones: What's RPi-specific and what's not?

Posted: Sat Mar 12, 2016 10:01 am
by Nable
Almost all MMIO addresses are SoC specific. Some of them are specific to the core of the SoC (e.g. for cortex-m3). I recommend you to learn about device tree: http://elinux.org/Device_Tree, it helps one to separate board-specific configuration entries from driver code.

Re: RPi bare bones: What's RPi-specific and what's not?

Posted: Sat Mar 12, 2016 10:08 am
by onlyonemac
You might want to separate "arm" into different types of "arm" because "arm" can mean a lot of different things. You don't want to leave it until the "platform" separation stage to distinguish between different types of "arm" because there are many incompatible platforms where "arm" means the same thing and you'll be repeating a lot of identical code for each platform if you do this (because that identical code can't be put as common code for the "arm" architecture because of how different kinds of "arm" can be incompatible).