This guide applies to the known kernels for the Galaxy Grand Neo, Trend Plus and Core Plus. These are all kernel version 3.4.5.
Board files for all the devices are located in arch/arm/mach-hawaii
(mach-java for BCM23550), and are prefixed with board-ss_
. They usually contain plenty of unused peripherals, so always double-check if the peripheral you’re looking at is actually enabled (usually there’s kernel config options you can cross-reference). Some devices are also defined in the devices.c
file in the mach-{hawaii/java} directory.
Some structs to look out for:
plat_serial8250_port hawaii_uart_platform_data[]
- information about the UART ports, plus their frequenciesbsc_adap_cfg bsc_i2c_cfg[]
- i2c data, including frequenciesspi_kona_platform_data hawaii_ssp0/1_info
- ssp 0/1 dataThere are also plenty of addresses for various peripherals stored in arch/arm/mach-{hawaii/java}/include/mach/rdb/brcm_rdb_sysmap.h
.
Clock data is stored in the clock.c file in the mach directory. Each clock has the following structs:
<NAME>_<TYPE>_clk_src_list
- list of source clocks; it’s a separate struct, usually placed above the general definition dictstatic struct <TYPE>_clk CLK_NAME(<NAME>)
- struct containing clock infoSome values to look out for:
.ccu_clk
- contains the CLK_NAME of the CCU clock.clk_en_mask
- the enable bit.gating_sel_mask
- the hw/sw select bit.stprsts_mask
- the sel bit.clk_div
- contains information about the clock dividerThese values are usually stored in rdb header files; a quick grep -iR
in the mach directory should point you towards the right file. A lot of values are stored in arch/arm/mach-{hawaii/java}/include/mach/rdb/brcm_rdb_kps_clk_mgr_reg.h
(slave clocks) or brcm_rdb_kpm_clk_mgr_reg.h
(master clocks).
Note that downstream uses masks, and mainline uses bits; thankfully, bits are stored alongside masks in the appropriate header files, and masks on mainline are generated by the driver when needed.
The arch/arm/plat-kona
directory contains various core platform-related drivers: the SMP driver, clock driver, and some other drivers we don’t yet understand.