Mainline:Broadcom Kona/Introduction: Difference between revisions

Created page with "The following page is a general introduction to the Broadcom Kona platform and getting started with mainlining. == Chip introduction == '''Broadcom Kona''' is a series of chips primarily marketed for mobile use, released between 2012 and 2013. It comprises of the following chips: * BCM28145/BCM28155 (Capri) * BCM21654 (Rhea) * BCM21663/BCM21664 (Hawaii) * BCM23550 (Java) These chips all share similar components, with a similar internal register layout. They can be gr..."
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 9: Line 9:
* BCM21663/BCM21664 (Hawaii)
* BCM21663/BCM21664 (Hawaii)
* BCM23550 (Java)
* BCM23550 (Java)
Capri kernel sources also mention BCM28150/BCM28160 which are codenamed Island and appear to be similar to Capri; however, they do not seem to have been included in any consumer-available hardware.
Similarily, mentions of chips codenamed Athena, Hera and Samoa appear in some kernel sources, but with no relevant kernel config options - it is unknown which SoCs, if any, they correspond to.


These chips all share similar components, with a similar internal register layout. They can be grouped into three "generations": the BCM281x5 is first, the BCM21654 is second, and the BCM2166x/BCM23550 is third.
These chips all share similar components, with a similar internal register layout. They can be grouped into three "generations": the BCM281x5 is first, the BCM21654 is second, and the BCM2166x/BCM23550 is third.
Line 18: Line 22:
Two downstream kernels exist for these chips:
Two downstream kernels exist for these chips:


* An older 3.0 kernel for the BCM281x5, and another variant for the BCM21654.
* An older 3.0 kernel for the BCM281x5, and another variant for the BCM21654. ([https://github.com/ghsr/android_kernel_samsung_i9152 BCM28155 (Samsung Galaxy Mega 5.8/crater)], [https://github.com/wulsic/android_kernel_samsung_nevisp BCM21654 (Samsung Galaxy Fame/nevisp)])
* A newer 3.4 kernel (later updated to 3.10), with support for the BCM21664 and BCM23550, as well as partial support for the BCM21654.
* A newer 3.4 kernel (later updated to 3.10), with support for the BCM21664 and BCM23550, as well as partial support for the BCM21654. ([https://github.com/knuxdroid/android_kernel_samsung_baffinlite 3.4 kernel (Samsung Galaxy Grand Neo/baffinlite)], [https://android.googlesource.com/kernel/bcm/+/refs/heads/android-bcm-tetra-3.10-marshmallow-dr1-wear-release 3.10 kernel (Sony Smartwatch 3/tetra)])


In both kernels, most of the relevant downstream drivers for the Kona platform are stored in <code>arch/arm/plat-kona</code>; the individual board files for each device and chip-specific info is stored in <code>arch/arm/mach-(codename)</code> (where <code>(codename)</code> is one of <code>capri</code>, <code>rhea</code>, <code>hawaii</code> or <code>java</code>).
In both kernels, most of the relevant downstream drivers for the Kona platform are stored in <code>arch/arm/plat-kona</code>; the individual board files for each device and chip-specific info is stored in <code>arch/arm/mach-(codename)</code> (where <code>(codename)</code> is one of <code>capri</code>, <code>rhea</code>, <code>hawaii</code> or <code>java</code>).
Line 53: Line 57:
[[File:Generate-dump-diff output example.png|thumb|Example screenshot showing the output of generate-dump-diff.py]]
[[File:Generate-dump-diff output example.png|thumb|Example screenshot showing the output of generate-dump-diff.py]]


I maintain a set of relevant reverse-engineering tools at [https://github.com/refractionware/reveng github.com/refractionware/reveng]. The most directly useful ones are:
[[User:Knuxify|knuxify]] maintains a set of relevant reverse-engineering tools at [https://github.com/refractionware/reveng github.com/refractionware/reveng]. The most directly useful ones are:


* <code>tools/devmem-read-block.sh</code> - given a start address and the offset of the last register (inclusive), dumps all of the registers.
* <code>tools/devmem-read-block.sh</code> - given a start address and the offset of the last register (inclusive), dumps all of the registers.
Line 63: Line 67:
* Copy <code>devmem-read-block.sh</code> to the device and dump the relevant registers; save the files in two separate directories, to make sure you don't mistake downstream for mainline
* Copy <code>devmem-read-block.sh</code> to the device and dump the relevant registers; save the files in two separate directories, to make sure you don't mistake downstream for mainline
* Run <code>generate-dump-diff.py</code> on the generated dumps and look at differences in the browser
* Run <code>generate-dump-diff.py</code> on the generated dumps and look at differences in the browser
=== Porting board files to DTS ===
New kernels use device trees to describe components. The Kona downstream kernels are too old to use it; rather, while they have some DTS support and files, they don't seem to actually be used in any of the production devices.
Instead, the relevant device info is stored in board files in <code>arch/arm/mach-(codename)</code> directories. These files contain the relevant setup for all componenets. There's usually a separate "board-bcm590xx" file that contains BCM590xx PMIC settings.
Note that board files contain configuration for lots of possible components that may not actually be present on your device; these are usually commented out with <code>#ifdef</code> statements referencing defconfig options. Make sure to have your device's defconfig handy for reference.
(todo: add more info here)


== See also ==
== See also ==


* [https://wiki.postmarketos.org/wiki/Mainlining Mainlining on the postmarketOS wiki]
* [https://wiki.postmarketos.org/wiki/Mainlining Mainlining on the postmarketOS wiki]