Skip to content

Instantly share code, notes, and snippets.

@Embedded-linux
Last active August 29, 2015 14:02
Show Gist options
  • Save Embedded-linux/1acaffc8249c584294ed to your computer and use it in GitHub Desktop.
Save Embedded-linux/1acaffc8249c584294ed to your computer and use it in GitHub Desktop.
Kernel-porting[Beaglebone]
File Name: am335x_evm_board.c
+MACHINE_START(AM335XEVM, "am335xevm")
+ /* Maintainer: Texas Instruments */
+ .atag_offset = 0x100,
+ .map_io = am335x_evm_map_io,
+ .init_early = am33xx_init_early,
+ .init_irq = ti81xx_init_irq,
+ .handle_irq = omap3_intc_handle_irq,
+ .timer = &omap3_am33xx_timer,
+ .init_machine = am335x_evm_init,
+MACHINE_END
->The Machine Start Macro is used to indentify
initialization functions to the Linux kernel
+ .atag_offset = 0x100,
->Boot parameter location passed form u-boot
+ .map_io = am335x_evm_map_io
static void __init am335x_evm_map_io(void)
{
omap2_set_globals_am33xx();
omapam33xx_map_common_io();
}
-> omapam33xx_map_common_io() is called from arch/arm/mach-omap2/common.c
+ .init_early = am33xx_init_early,
->The am33xx_init_early is a function within
the OMAP2+ Shared common code
-> This is called directly from the common code
without modification
.init_irq = ti81xx_init_irq,
-> arch/arm/mach-omap2/irq.c
ti81xx_init_irq()
Interrupt initilization function
.handle_irq = omap3_intc_handle_irq
-> arch/arm/mach-omap2/irq.c
omap3_intc_handle_irq()
Interrupt handler function regration with the kernel.
.timer = &omap3_am33xx_timer,
-> arch/arm/mach-omap2/timer.c
omap3_am33xx_timer()
{
...
....
}
system timer definition.
.init_machine = am335x_evm_init,
-> arch/arm/mach-omap2/board-am335xevm.c
static void __init am335x_evm_init(void)
{
am33xx_cpuidle_init();
am33xx_mux_init(board_mux);
omap_serial_init();
am335x_evm_i2c_init();
omap_sdrc_init(NULL, NULL);
usb_musb_init(&musb_board_data);
omap_board_config = am335x_evm_config;
omap_board_config_size = ARRAY_SIZE(am335x_evm_config);
/* Create an alias for icss clock */
if (clk_add_alias("pruss", NULL, "pruss_uart_gclk", NULL))
pr_warn("failed to create an alias: icss_uart_gclk --> pruss\n");
/* Create an alias for gfx/sgx clock */
if (clk_add_alias("sgx_ck", NULL, "gfx_fclk", NULL))
pr_warn("failed to create an alias: gfx_fclk --> sgx_ck\n");
}
-> am33xx_cpuidle_init();
am33xx_mux_init(board_mux);
omap_serial_init();
Above threee functions are from "arch/arm/mach-omap2/cpuidle33xx.c"
[Loads cpu idle driver for AM33xx]
"arch/arm/mach-omap2/mux.c"
[Intilizes omap pin mux abstraction]
"arch/arm/mach-omap2/serial.c"
[Enables UARTs configured for the omap platforms,
set up pin mux and clock]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment