summaryrefslogtreecommitdiff
path: root/zephyr/linker
Commit message (Collapse)AuthorAgeFilesLines
* Zephyr: Remove binman.dtsi requirementsBrian J. Nemec2023-01-202-3/+2
| | | | | | | | | | | | | | | | | | | | Starfish uses the EC build environment but does not use the CrOSEC stubs and does not use the EC partition. This leads to linker errors when building due to CONFIG_PLATFORM_EC_RW_TOTAL_IMAGE_SIZE dependencies which is undefined on Zephyr only targets. Adds defined() guards to checks in the linker to avoid build failures. BUG=b:243700103 BRANCH=None TEST=None Change-Id: I98b207f25edd4f6306fa9ed3a0c1a0ce91f46856 Signed-off-by: Brian Nemec <bnemec@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4182530 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: fwid: Move RW FWID to end of the flashKeith Short2023-01-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | Force the RW_FWID to always reside in the last 32 bytes of the flash. This ensures that the RW_FW and RW_FWID sections never move within the full EC binary. The FMAP is only stored in RO, so this ensures future compatibility with RW firmware image size changes. BUG=b:264229880 BRANCH=none TEST=Run "futility dump_fmap ec.bin" and verify RW_FWID is located in last 32-bytes. TEST=On Herobrine, validate EC sync and validate FMAP manifest when the RO and RW images are different versions. Change-Id: I2d96d602f37ca9fafe4d01cbf1a578e20861abaa Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4143799 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* system: Ensure space for panic and jump dataRob Barnes2022-11-172-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure space is available for end of ram data. End of ram data must be located at the very end of noinit ram. This currently includes panic_data followed by jump_data. This is being enforced with linker asserts and build asserts rather than allocating the space directly so RAM utiliztion reports are still relevant. Introduce PLATFORM_EC_PRESERVED_END_OF_RAM_SIZE config option and default it to 1KB. This can be adjusted on boards that are constrained. BUG=b:246778588,b:246798928 BRANCH=None TEST=./twister -c -s zephyr/test/jump_tags/jump_tags.default && make run-kb_8042 Change-Id: I444bbe3a583396b4f9b104bb6999e78ae3ff6f2f Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3896272 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-126-6/+6
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Delete CONFIG_PLATFORM_EC_MPUKeith Short2022-08-011-1/+1
| | | | | | | | | | | | | | CONFIG_PLATFORM_EC_MPU is redundant with the Zephyr Kconfig option, CONFIG_MPU. Use the Zephyr option directly. BUG=none BRANCH=none TEST=zmake testall --static; compare binaries Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iff92c7e9fe3a003366d153e618d2450b367fd169 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791660 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: mchp: Add zephyr Kconfig and CMakeListsmartin yan2022-04-062-0/+23
| | | | | | | | | | | | | Add zephyr Kconfig and CMakeLists to support shim layer code BUG=none BRANCH=main TEST=zmake testall and make buildall -j$(nproc) Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I248ad8289b40e1d5a921f0b0eecf1d00dbfb8e24 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3563498 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr/hooks: don't store hooks in RAMPeter Marheine2022-03-232-3/+8
| | | | | | | | | | | | | | | | | This saves 8 bytes times the number of hook handlers in RAM, which amounts to nearly 1KB in most configurations. It trades that RAM for higher cost in calling handlers since the hook list must be traversed multiple times for each notification, but that matches the ECOS behavior which implies the performance cost is acceptable. BUG=b:223044986 TEST=zmake testall; 944 bytes of RAM are saved on Nereid BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I823f2a974faf69fa5195f11c645b569fb57854a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3529602 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: riscv: use __rom_region_size for image sizeJack Rosenthal2021-09-151-1/+1
| | | | | | | | | | | | | | | | _image_rom_size was renamed to __rom_region_size in v2.7. We backported this to our v2.6 branches, so switch the name ahead of time so we're prepared for the v2.7 uprev. BUG=b:198824039 BRANCH=none TEST=compile hayato EC with zephyr v2.7 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Iae6e7008d729f77cd66ed1a35e93001511d9cea8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3163562 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: riscv: linker: correct __image_sizeDino Li2021-08-191-2/+1
| | | | | | | | | | | | | | | | | | | | With CL:3088970, the _image_rom_size has been able to provide correct image size. So configure __image_size = _image_rom_size; BRANCH=none BUG=b:195954913 TEST=software sync is successfully. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Cq-Depend: chromium:3088970 Change-Id: I23a2f33aa15df7a8469d5591dc8d310d0313be92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3105912 Tested-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: shim: reimplement hooks using iterablesFabio Baltieri2021-08-102-0/+4
| | | | | | | | | | | | | | | | | | Reimplement the hooks shim code using Zephyr iterable sections. Keep the existing hook_registry based structure, gets rid of the per-hook init functions and instead initializes all the list nodes from a single init call. BRANCH=none BUG=b:195521227 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ic166d214ee1dcd1431ec484e5014cb297f7fb8c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069399 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: shim: reimplement mkbp_event using iterablesFabio Baltieri2021-08-101-0/+4
| | | | | | | | | | | | | | | Rewrite the MKBP events shim using iterable sections. BRANCH=none BUG=b:195521227 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ia96fb9ec06b1a86b1be293209db317a361ae4741 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069398 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: shim: reimplement host commands using iterablesFabio Baltieri2021-08-102-0/+5
| | | | | | | | | | | | | | | | | Rewrite the host command shim using Zephyr iterable sections. This allows initializing the HC structure statically and gets rid of the runtime init code entirely. BRANCH=none BUG=b:195521227 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I94a55f8eb3e1d58de6a1d93c31b6170a5541a1fc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3010284 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: linker: riscv: provide __image_size symbolDino Li2021-08-061-0/+3
| | | | | | | | | | | | | | | This makes riscv core providing __image_size symbol for calculating hash. BRANCH=none BUG=b:194794622 TEST=__image_size is equal to ro/rw binarys' size. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I7ffd8da6d0bb94362cb137458bf9962a5cf69c62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3066837 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: npcx9: Add linker elements needed for flash api workaroundYuval Peress2021-06-041-0/+14
| | | | | | | | | | | | BRANCH=none BUG=b:188605676 TEST=build brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I900f4af147e048a374b56875579d838deaa17eae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2936006 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: npcx: Add non-psl hibernate implementationMulin Chao2021-04-142-0/+14
| | | | | | | | | | | | | | | | | | | | | | | Implements non-psl hibernate mechanism for cros_system driver. First, we plan a little hibernate function locates in the last 32K ram block in npcx7 series. Then power down the other ram blocks and go to deep sleep mode for better power consumptions. Please notice do not use global or call the other functions in this hibernate utility since we have turned off the other ram blocks. BUG=b:177904393, b:183745774 BRANCH=none TEST=zmake testall TEST=All wake-up GPIOs can wake-up ec from hibernating on npcx7 evb. Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I48f95b0e616ad27f77a6d0ada8251ec438427741 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821116 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: efs2: Compute the __image_size for efs2 in the linkerYuval Peress2021-02-262-0/+18
| | | | | | | | | | | | | | | | | | | | The __image_size should match used portion of the flash. Note that in Zephyr, different linker scripts have different variables. _flash_used is only available for the verified chips. Other chips may use a different name or may require manual calculation. Compute the size by using the Zephyr sections. This is the parallel to core/cortex-m/ec.lds.S's logic. BRANCH=none BUG=b:164421798 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: If91acd5dc2b925ad226f2d1c3feccc77617e04df Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2721495 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Add support for CONFIG_MPUSimon Glass2021-02-132-0/+26
| | | | | | | | | | | | | | | | | | Add this option so that the Memory-Protection Unit (MPU) can be enabled. The implementation is still to be worked out. Note that CONFIG_PLATFORM_EC_EXTERNAL_STORAGE is not defined, as it should be. That work is ongoing elsewhere. BUG=b:180039888 BRANCH=none TEST=build zephyr volteer Build ECOS for volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ie26e8ba4b3f0b8024930e42fbbb03f0f2a26f3da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691566 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: fix version console commandYuval Peress2021-02-102-0/+14
Fixes the data seen by the version console command. Since the version data structure is suppose to be at the same offset from the start of the image, running `version` in the ec terminal previously did not yield any values for the RW image (the .rodata.ver section was at a different offset for RW vs RO). - Add a new fixed-sections.ld file that adds the .fixed section. - Include it into all our builds at the start of the sections. - Add a new macro in common.h to allow us to specify that a section should be at a fixed location (FIXED_SECTION). - Use that macro to put the version information in that location. Sample output: 21-02-09 12:59:45.531 version 21-02-09 12:59:46.638 Chip: chromeos emu 21-02-09 12:59:46.642 Board: 1 21-02-09 12:59:46.647 RO: _v2.0.7390+2d340147c 21-02-09 12:59:46.672 RW: _v2.0.7390+2d340147c 21-02-09 12:59:46.675 Build: _v2.0.7390+2d340147c 21-02-09 12:59:46.680 2021-02-09 12:58:26 BRANCH=none BUG=b:164421798 TEST=build volteer, flash, run `version` command. TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id19a07d16b5e307d81e8a411b933d9e9a674eb27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685339 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>