SlideShare una empresa de Scribd logo
1 de 24
© 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?

Más contenido relacionado

La actualidad más candente (20)

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom Board
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 

Destacado (16)

BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
File Systems
File SystemsFile Systems
File Systems
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
References
ReferencesReferences
References
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Interrupts
InterruptsInterrupts
Interrupts
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Serial Drivers
Serial DriversSerial Drivers
Serial Drivers
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 

Similar a BeagleBone Black Bootloaders

U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial艾鍗科技
 
建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card艾鍗科技
 
my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 infoisky guard
 
Aplus essentials-exam-cram
Aplus essentials-exam-cramAplus essentials-exam-cram
Aplus essentials-exam-cramPeter Sonko
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220AndrewWright224
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadAndrewWright224
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android EmulatorSamael Wang
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_enconfidencial
 
1 study of motherboard
1 study of motherboard1 study of motherboard
1 study of motherboardAnkit Dubey
 
101 1.1 hardware settings v2
101 1.1 hardware settings v2101 1.1 hardware settings v2
101 1.1 hardware settings v2Acácio Oliveira
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON
 

Similar a BeagleBone Black Bootloaders (20)

U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial
 
建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 info
 
Aplus essentials-exam-cram
Aplus essentials-exam-cramAplus essentials-exam-cram
Aplus essentials-exam-cram
 
101 1.1 hardware settings
101 1.1 hardware settings101 1.1 hardware settings
101 1.1 hardware settings
 
PowerAI Deep Dive ( key points )
PowerAI Deep Dive ( key points )PowerAI Deep Dive ( key points )
PowerAI Deep Dive ( key points )
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
Motherboard
MotherboardMotherboard
Motherboard
 
Slimline Open Firmware
Slimline Open FirmwareSlimline Open Firmware
Slimline Open Firmware
 
05 - BIOS.ppt
05 - BIOS.ppt05 - BIOS.ppt
05 - BIOS.ppt
 
P1 unit 2
P1 unit 2P1 unit 2
P1 unit 2
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_en
 
1.1 hardware settings v2
1.1 hardware settings v21.1 hardware settings v2
1.1 hardware settings v2
 
1 study of motherboard
1 study of motherboard1 study of motherboard
1 study of motherboard
 
101 1.1 hardware settings v2
101 1.1 hardware settings v2101 1.1 hardware settings v2
101 1.1 hardware settings v2
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
 

Más de SysPlay eLearning Academy for You (12)

Linux Internals Part - 3
Linux Internals Part - 3Linux Internals Part - 3
Linux Internals Part - 3
 
Linux Internals Part - 2
Linux Internals Part - 2Linux Internals Part - 2
Linux Internals Part - 2
 
Linux Internals Part - 1
Linux Internals Part - 1Linux Internals Part - 1
Linux Internals Part - 1
 
Kernel Timing Management
Kernel Timing ManagementKernel Timing Management
Kernel Timing Management
 
Understanding the BBB
Understanding the BBBUnderstanding the BBB
Understanding the BBB
 
POSIX Threads
POSIX ThreadsPOSIX Threads
POSIX Threads
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
Cache Management
Cache ManagementCache Management
Cache Management
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Introduction to BeagleBone Black
Introduction to BeagleBone BlackIntroduction to BeagleBone Black
Introduction to BeagleBone Black
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 
Linux System
Linux SystemLinux System
Linux System
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

BeagleBone Black Bootloaders

  • 1. © 2015-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. BeagleBone Black Bootloaders
  • 2. 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. 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. 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. 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. 6© 2015-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. X-Loader
  • 7. 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. 8© 2015-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Let's Get Down to Source Code
  • 9. 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. 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. 11© 2015-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. U-Boot
  • 12. 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. 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. 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. 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. 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. 17© 2015-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Let's Get Down to Source Code
  • 18. 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. 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. 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. 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. 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. 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. 24© 2015-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?