SlideShare a Scribd company logo
© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
BeagleBone Black Bootloaders
2© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
BBB Memory Organization
Beagle Booting Process
W's of X-Loader
BSP in X-Loader
W's of U-Boot
BSP in U-Boot
3© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
BBB Memory Organization
DDR
512MB
ROM
Internal
RAM
64KB
SOC
BeagleBone Black
0x80000000
0x40200000
0x402F0400 EMMC
4GB
Ext.
MMC
4© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
General Booting of BeagleBoard
ROM
Code
Internal
ROM
X-Loader
Internal
SRAM
Internal
ROM
U-Boot
External
DDR
Kernel
External
DDR
5© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
BBB Images
ROM
Code
X-Loader
SOC
BeagleBone Black
ROM
Internal RAM
DDR
u-boot
bbb.dtb
uImage
Ramdisk/initrd
(Ramdisk Boot)
6© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
X-Loader
7© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
W's of X-Loader
First stage bootloader for Beagle Board
Derived from u-boot – the second stage
bootloader
Named as MLO (Memory Loader) in filesystem.
Runs in an internal SRAM
Loads the second stage bootloader i.e. U-Boot
8© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Let's Get Down to Source Code
9© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
X-Loader Code Flow
cpu/armv7/start.S
reset()
Disable IRQ & FIQ.
Switch to
supervisor mode
Low Level Initialization
cpu_init_cp15()
Invalidate and
disable
Instruction & data
Cache
Disable MMU
cpu/armv7/lowlevel_i
nit.S
lowlevel_init()
arm/lib/crt0.S
_main()
C Runtime setup
arm/lib/spl.c
board_init_f()
Early Board Setup
Clear BSS and jump
to board_init_r()
Common/spl/spl.c
board_init_r()
Load the u-boot
10© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
X-Loader for BBB
Board configuration
include/configs/am335x_evm.h
CPU dependent code
arch/arm/cpu/armv7/*.c
arch/arm/cpu/armv7/lowlevel_init.S
arch/arm/lib/crt0.S
arch/arm/cpu/armv7/am33x/board.c
arch/arm/lib/spl.c
Board dependent code
Board/ti/am335x/board.*
Board independent code
common/spl/spl.c
11© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot
12© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
W's of U-Boot
Universal Bootloader (U-Boot)
An Open Source Bootloader
With minimal changes, can be ported for any board
GRUB/LILO
Designed with x-86 in mind
Huge in Size
Needs to be changed drastically for porting on other
architecture
13© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Source Tree
arch – Architecture dependent Code
board – Board dependent Code
common – Environment & Command Line Code
doc – Documentation
drivers – Device specific Drivers
fs – File System support Code
include – Headers
lib – Compression, Encryption related Code
net – Minimal Network Stack
tools – U-Boot Utilities (mkimage is here)
14© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Initialization Details
Bootloader starts its execution from flash /RAM
Hardware Diagnostics, like POST, …
Configuring the CPU speed, MMU setting, etc
Memory setup & initialization
Setting up interfacing ports like serial, VGA, …
Sets up the address of the boot parameters
15© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Configuration
Creating a configuration file for the board
Adding a Kconfig file in 'board/<vendor>/<board>
with below info:
Architecture
CPU
Board
Vendor (May be NULL)
SoC (May be NULL)
16© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Configuration Output
Configuration files for use in C Sources
include/generated/autoconf.h
spl/include/generated/autoconf.h (For SPL)
include/config.h
include/configs/<board>.h
Configuration files for Makefile
include/config/auto.conf
spl/include/config/auto.conf (For SPL)
include/autoconf.mk
17© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Let's Get Down to Source Code
18© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Code Flow
cpu/armv7/start.S
reset()
Disable IRQ & FIQ.
Switch to
supervisor mode
Low Level Initialization
cpu_init_cp15()
Invalidate and
disable
Instruction & data
Cache
Disable MMU
cpu/armv7/lowlevel_i
nit.S
lowlevel_init()
arm/lib/crt0.S
_main()
C Runtime setup
arm/lib/board.c
board_init_f()
Early Board Setup
Calculate
Addresses (SP,
Dest, GD) for
Relocation
Call the board
initialization
functions
Arch/arm/lib/reloc
ate.S
relocate_code()
General Relocation
arm/lib/crt0.S
_main()
Clear BSS, Setup GD and jump
to board_init_r()
arm/lib/board.c
board_init_r()
Final Board Setup
Board/it/am335x/board.c
board_init()
Board specific device setup
env_relocate()
Setup Environment
common/main.c
main_loop()
Boot the kernel or give out
the u-boot shell
19© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Let's Check
What is the starting point of u-boot?
Where is the address of the Environmental Variables set?
Where is RAM initialized?
Which file is the interface between the architecture dependent code & board dependent
code?
Where is serial initialized?
From where is the kernel invoked? And what are the parameters passed to the kernel?
Where is default environment defined?
where is the board dependent file for BBB?
Where is the configuration file for BBB?
Where is the architecture number set?
Where is the pin multiplexing done?
From where does the boot delay comes?
20© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot BSP
Board configuration
include/configs/am335x_evm.h
CPU dependent code
arch/arm/cpu/armv7/*.c
arch/arm/cpu/armv7/lowlevel_init.S
arch/arm/lib/crt0.S
arch/arm/lib/relocate.S
arch/arm/cpu/armv7/am33x/board.c
arch/arm/lib/board.c
Board dependent code
Board/ti/am335x/board.*
Board independent code
common/*
driver, fs, common(cmd, flash, env..)
21© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Porting
Implies adding a new Board to U-Boot
That entails
Adding board specific code at the right places
Adding the new board directory under board/ with
Makefile
Initialization Code for the Board
Kconfig file
Adding the new board header under include/configs/ with
Configuration for the Board
22© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Porting Hands On
Add the configuration file .h in include/configs
Add the Kconfig file at board/<vendor>/<soc>/
Modify the arch/arm/Kconfig to add the menu item for the board
and source the board dependent Kconfig file
Add the board dependent file at board/<vendor>/<soc>/
Modify the path for linker script at
include/configs/<config_name.h>
In the linker script, add the path for built_in.o for the board.
Add the defconfig file in configs folder. Add atleast
CONFIG_ARM and CONFIG_TARGET_<BOARD>
23© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all have learnt?
BBB Memory Organization
Beagle Booting Process
W's of X-Loader
BSP in X-Loader
W's of U-Boot
BSP in U-Boot
24© 2015-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

What's hot (20)

PDF
Board Bringup
Anil Kumar Pugalia
 
PDF
Kdump and the kernel crash dump analysis
Buland Singh
 
PDF
BusyBox for Embedded Linux
Emertxe Information Technologies Pvt Ltd
 
PDF
Linux Internals - Part I
Emertxe Information Technologies Pvt Ltd
 
PDF
Linux Internals - Part III
Emertxe Information Technologies Pvt Ltd
 
PPT
U boot porting guide for SoC
Macpaul Lin
 
PDF
C Programming - Refresher - Part III
Emertxe Information Technologies Pvt Ltd
 
PDF
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Anne Nicolas
 
PDF
Build your own embedded linux distributions by yocto project
Yen-Chin Lee
 
PPTX
Linux Initialization Process (1)
shimosawa
 
PPT
linux device driver
Rahul Batra
 
PDF
Launch the First Process in Linux System
Jian-Hong Pan
 
PDF
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
linuxlab_conf
 
PPTX
Linux device drivers
Abhishek Sagar
 
PPTX
Linux Initialization Process (2)
shimosawa
 
PDF
Arm device tree and linux device drivers
Houcheng Lin
 
Board Bringup
Anil Kumar Pugalia
 
Kdump and the kernel crash dump analysis
Buland Singh
 
BusyBox for Embedded Linux
Emertxe Information Technologies Pvt Ltd
 
Linux Internals - Part III
Emertxe Information Technologies Pvt Ltd
 
U boot porting guide for SoC
Macpaul Lin
 
C Programming - Refresher - Part III
Emertxe Information Technologies Pvt Ltd
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Anne Nicolas
 
Build your own embedded linux distributions by yocto project
Yen-Chin Lee
 
Linux Initialization Process (1)
shimosawa
 
linux device driver
Rahul Batra
 
Launch the First Process in Linux System
Jian-Hong Pan
 
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
linuxlab_conf
 
Linux device drivers
Abhishek Sagar
 
Linux Initialization Process (2)
shimosawa
 
Arm device tree and linux device drivers
Houcheng Lin
 

Viewers also liked (17)

PDF
Linux Porting
Anil Kumar Pugalia
 
PDF
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
 
PDF
File Systems
Anil Kumar Pugalia
 
PDF
gcc and friends
Anil Kumar Pugalia
 
PDF
References
Anil Kumar Pugalia
 
PDF
Kernel Debugging & Profiling
Anil Kumar Pugalia
 
PDF
Embedded C
Anil Kumar Pugalia
 
PDF
Block Drivers
Anil Kumar Pugalia
 
PDF
PCI Drivers
Anil Kumar Pugalia
 
PDF
Interrupts
Anil Kumar Pugalia
 
PDF
Character Drivers
Anil Kumar Pugalia
 
PDF
File System Modules
Anil Kumar Pugalia
 
PDF
Network Drivers
Anil Kumar Pugalia
 
PDF
Introduction to Linux Drivers
Anil Kumar Pugalia
 
Linux Porting
Anil Kumar Pugalia
 
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
 
File Systems
Anil Kumar Pugalia
 
gcc and friends
Anil Kumar Pugalia
 
References
Anil Kumar Pugalia
 
Kernel Debugging & Profiling
Anil Kumar Pugalia
 
Embedded C
Anil Kumar Pugalia
 
Block Drivers
Anil Kumar Pugalia
 
PCI Drivers
Anil Kumar Pugalia
 
Interrupts
Anil Kumar Pugalia
 
Character Drivers
Anil Kumar Pugalia
 
File System Modules
Anil Kumar Pugalia
 
Network Drivers
Anil Kumar Pugalia
 
Introduction to Linux Drivers
Anil Kumar Pugalia
 
Ad

Similar to BeagleBone Black Bootloaders (20)

PDF
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
PDF
BeagleBoard-xM Booting Process
SysPlay eLearning Academy for You
 
PPTX
Bootloaders (U-Boot)
Omkar Rane
 
PDF
Introduction to Modern U-Boot
GlobalLogic Ukraine
 
PDF
Details on Bootloaders in Embedded LInux
Pradeep Tewani
 
PPTX
U-Boot Porting on New Hardware
RuggedBoardGroup
 
PDF
Embedded_Linux_Booting
Rashila Rr
 
PDF
Armboot process zeelogic
Aleem Shariff
 
PPT
Bootstrap process boot loader
idrajeev
 
PPTX
BSP.pptx
taruian
 
PPTX
System Booting Process overview
RajKumar Rampelli
 
PPT
Bootstrap process of u boot (NDS32 RISC CPU)
Macpaul Lin
 
PDF
Masters porting linux
Shashank Asthana
 
PPTX
DSS2_Explorations.pptx
ssuser5fb79d
 
PDF
Doc7745
Alfredo Santillan
 
PPTX
BOOTABLE OPERATING SYSTEM PPT
Shahzeb Pirzada
 
PDF
Boot sequence
JungMinSEO5
 
PDF
Jagan Teki - U-boot from scratch
linuxlab_conf
 
PPTX
Когда предрелизный не только софт
CEE-SEC(R)
 
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
BeagleBoard-xM Booting Process
SysPlay eLearning Academy for You
 
Bootloaders (U-Boot)
Omkar Rane
 
Introduction to Modern U-Boot
GlobalLogic Ukraine
 
Details on Bootloaders in Embedded LInux
Pradeep Tewani
 
U-Boot Porting on New Hardware
RuggedBoardGroup
 
Embedded_Linux_Booting
Rashila Rr
 
Armboot process zeelogic
Aleem Shariff
 
Bootstrap process boot loader
idrajeev
 
BSP.pptx
taruian
 
System Booting Process overview
RajKumar Rampelli
 
Bootstrap process of u boot (NDS32 RISC CPU)
Macpaul Lin
 
Masters porting linux
Shashank Asthana
 
DSS2_Explorations.pptx
ssuser5fb79d
 
BOOTABLE OPERATING SYSTEM PPT
Shahzeb Pirzada
 
Boot sequence
JungMinSEO5
 
Jagan Teki - U-boot from scratch
linuxlab_conf
 
Когда предрелизный не только софт
CEE-SEC(R)
 
Ad

More from SysPlay eLearning Academy for You (12)

PDF
Linux Internals Part - 3
SysPlay eLearning Academy for You
 
PDF
Linux Internals Part - 2
SysPlay eLearning Academy for You
 
PDF
Linux Internals Part - 1
SysPlay eLearning Academy for You
 
PDF
Kernel Timing Management
SysPlay eLearning Academy for You
 
PDF
Understanding the BBB
SysPlay eLearning Academy for You
 
PDF
Introduction to BeagleBone Black
SysPlay eLearning Academy for You
 
PDF
Introduction to BeagleBoard-xM
SysPlay eLearning Academy for You
 
Linux Internals Part - 3
SysPlay eLearning Academy for You
 
Linux Internals Part - 2
SysPlay eLearning Academy for You
 
Linux Internals Part - 1
SysPlay eLearning Academy for You
 
Kernel Timing Management
SysPlay eLearning Academy for You
 
Understanding the BBB
SysPlay eLearning Academy for You
 
Introduction to BeagleBone Black
SysPlay eLearning Academy for You
 
Introduction to BeagleBoard-xM
SysPlay eLearning Academy for You
 

Recently uploaded (20)

PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 

BeagleBone Black Bootloaders

  • 1. © 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. BeagleBone Black Bootloaders
  • 2. 2© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. What to Expect? BBB Memory Organization Beagle Booting Process W's of X-Loader BSP in X-Loader W's of U-Boot BSP in U-Boot
  • 3. 3© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. BBB Memory Organization DDR 512MB ROM Internal RAM 64KB SOC BeagleBone Black 0x80000000 0x40200000 0x402F0400 EMMC 4GB Ext. MMC
  • 4. 4© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. General Booting of BeagleBoard ROM Code Internal ROM X-Loader Internal SRAM Internal ROM U-Boot External DDR Kernel External DDR
  • 5. 5© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. BBB Images ROM Code X-Loader SOC BeagleBone Black ROM Internal RAM DDR u-boot bbb.dtb uImage Ramdisk/initrd (Ramdisk Boot)
  • 6. 6© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. X-Loader
  • 7. 7© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. W's of X-Loader First stage bootloader for Beagle Board Derived from u-boot – the second stage bootloader Named as MLO (Memory Loader) in filesystem. Runs in an internal SRAM Loads the second stage bootloader i.e. U-Boot
  • 8. 8© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. Let's Get Down to Source Code
  • 9. 9© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. X-Loader Code Flow cpu/armv7/start.S reset() Disable IRQ & FIQ. Switch to supervisor mode Low Level Initialization cpu_init_cp15() Invalidate and disable Instruction & data Cache Disable MMU cpu/armv7/lowlevel_i nit.S lowlevel_init() arm/lib/crt0.S _main() C Runtime setup arm/lib/spl.c board_init_f() Early Board Setup Clear BSS and jump to board_init_r() Common/spl/spl.c board_init_r() Load the u-boot
  • 10. 10© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. X-Loader for BBB Board configuration include/configs/am335x_evm.h CPU dependent code arch/arm/cpu/armv7/*.c arch/arm/cpu/armv7/lowlevel_init.S arch/arm/lib/crt0.S arch/arm/cpu/armv7/am33x/board.c arch/arm/lib/spl.c Board dependent code Board/ti/am335x/board.* Board independent code common/spl/spl.c
  • 11. 11© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot
  • 12. 12© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. W's of U-Boot Universal Bootloader (U-Boot) An Open Source Bootloader With minimal changes, can be ported for any board GRUB/LILO Designed with x-86 in mind Huge in Size Needs to be changed drastically for porting on other architecture
  • 13. 13© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Source Tree arch – Architecture dependent Code board – Board dependent Code common – Environment & Command Line Code doc – Documentation drivers – Device specific Drivers fs – File System support Code include – Headers lib – Compression, Encryption related Code net – Minimal Network Stack tools – U-Boot Utilities (mkimage is here)
  • 14. 14© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Initialization Details Bootloader starts its execution from flash /RAM Hardware Diagnostics, like POST, … Configuring the CPU speed, MMU setting, etc Memory setup & initialization Setting up interfacing ports like serial, VGA, … Sets up the address of the boot parameters
  • 15. 15© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Configuration Creating a configuration file for the board Adding a Kconfig file in 'board/<vendor>/<board> with below info: Architecture CPU Board Vendor (May be NULL) SoC (May be NULL)
  • 16. 16© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Configuration Output Configuration files for use in C Sources include/generated/autoconf.h spl/include/generated/autoconf.h (For SPL) include/config.h include/configs/<board>.h Configuration files for Makefile include/config/auto.conf spl/include/config/auto.conf (For SPL) include/autoconf.mk
  • 17. 17© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. Let's Get Down to Source Code
  • 18. 18© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Code Flow cpu/armv7/start.S reset() Disable IRQ & FIQ. Switch to supervisor mode Low Level Initialization cpu_init_cp15() Invalidate and disable Instruction & data Cache Disable MMU cpu/armv7/lowlevel_i nit.S lowlevel_init() arm/lib/crt0.S _main() C Runtime setup arm/lib/board.c board_init_f() Early Board Setup Calculate Addresses (SP, Dest, GD) for Relocation Call the board initialization functions Arch/arm/lib/reloc ate.S relocate_code() General Relocation arm/lib/crt0.S _main() Clear BSS, Setup GD and jump to board_init_r() arm/lib/board.c board_init_r() Final Board Setup Board/it/am335x/board.c board_init() Board specific device setup env_relocate() Setup Environment common/main.c main_loop() Boot the kernel or give out the u-boot shell
  • 19. 19© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. Let's Check What is the starting point of u-boot? Where is the address of the Environmental Variables set? Where is RAM initialized? Which file is the interface between the architecture dependent code & board dependent code? Where is serial initialized? From where is the kernel invoked? And what are the parameters passed to the kernel? Where is default environment defined? where is the board dependent file for BBB? Where is the configuration file for BBB? Where is the architecture number set? Where is the pin multiplexing done? From where does the boot delay comes?
  • 20. 20© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot BSP Board configuration include/configs/am335x_evm.h CPU dependent code arch/arm/cpu/armv7/*.c arch/arm/cpu/armv7/lowlevel_init.S arch/arm/lib/crt0.S arch/arm/lib/relocate.S arch/arm/cpu/armv7/am33x/board.c arch/arm/lib/board.c Board dependent code Board/ti/am335x/board.* Board independent code common/* driver, fs, common(cmd, flash, env..)
  • 21. 21© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Porting Implies adding a new Board to U-Boot That entails Adding board specific code at the right places Adding the new board directory under board/ with Makefile Initialization Code for the Board Kconfig file Adding the new board header under include/configs/ with Configuration for the Board
  • 22. 22© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Porting Hands On Add the configuration file .h in include/configs Add the Kconfig file at board/<vendor>/<soc>/ Modify the arch/arm/Kconfig to add the menu item for the board and source the board dependent Kconfig file Add the board dependent file at board/<vendor>/<soc>/ Modify the path for linker script at include/configs/<config_name.h> In the linker script, add the path for built_in.o for the board. Add the defconfig file in configs folder. Add atleast CONFIG_ARM and CONFIG_TARGET_<BOARD>
  • 23. 23© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. What all have learnt? BBB Memory Organization Beagle Booting Process W's of X-Loader BSP in X-Loader W's of U-Boot BSP in U-Boot
  • 24. 24© 2015-17 SysPlay Workshops <[email protected]> All Rights Reserved. Any Queries?