James3
August 8, 2024, 6:02pm
1
Hi,
I have been looking at the EC source code.
git clone GitHub - FrameworkComputer/EmbeddedController: Embedded Controller firmware for the Framework Laptop
Where is “GPIO_TYPEC0_VBUS_ON_EC” defined ?
Grep of the source gives:
grep -r GPIO_TYPEC0_VBUS_ON_EC *
board/hx20/cypress5525.c: usb_c_extpower_present |= gpio_get_level(GPIO_TYPEC0_VBUS_ON_EC) ? BIT(0) : 0;
board/hx20/cypress5525.c: gpio_enable_interrupt(GPIO_TYPEC0_VBUS_ON_EC);
board/hx20/cypress5525.c: gpio_set_level(GPIO_TYPEC0_VBUS_ON_EC, 0);
board/hx20/cypress5525.c: gpio_set_level(GPIO_TYPEC0_VBUS_ON_EC, mask & BIT(0) ? 1: 0);
board/hx20/cypress5525.c: gpio_set_level(GPIO_TYPEC0_VBUS_ON_EC, 1);
board/hx20/led.c: port_charging_active = gpio_get_level(GPIO_TYPEC0_VBUS_ON_EC) ||
So, where is the “#define ” for it?
git branch: hx20-hx30
Should I use a different branch for the FW16 ?
You should be using lotus-zephyr
branch for framework 13/16.
James3
November 16, 2024, 6:38pm
3
When building EC, which “board” should I select for the FW16 EC ?
James3
November 16, 2024, 11:33pm
5
I checkout the lotus-zephtr branch.
git status
On branch lotus-zephyr
make -j BOARD=lotus
Makefile:25: *** unable to locate BOARD lotus. Stop.
For a choice of boards for me to choose from:
EmbeddedController/board$ grep -ri npcx9m3f *
adlrvpp_npcx/build.mk:CHIP_VARIANT:=npcx9m3f
agah/build.mk:CHIP_VARIANT:=npcx9m3f
anahera/build.mk:CHIP_VARIANT:=npcx9m3f
aurash/build.mk:CHIP_VARIANT:=npcx9m3f
banshee/build.mk:CHIP_VARIANT:=npcx9m3f
brask/build.mk:CHIP_VARIANT:=npcx9m3f
brya/build.mk:CHIP_VARIANT:=npcx9m3f
constitution/build.mk:CHIP_VARIANT:=npcx9m3f
crota/build.mk:CHIP_VARIANT:=npcx9m3f
felwinter/build.mk:CHIP_VARIANT:=npcx9m3f
gaelin/build.mk:CHIP_VARIANT:=npcx9m3f
gimble/build.mk:CHIP_VARIANT:=npcx9m3f
gladios/build.mk:CHIP_VARIANT:=npcx9m3f
hades/build.mk:CHIP_VARIANT:=npcx9m3f
herobrine/build.mk:CHIP_VARIANT:=npcx9m3f
kano/build.mk:CHIP_VARIANT:=npcx9m3f
kinox/build.mk:CHIP_VARIANT:=npcx9m3f
kuldax/build.mk:CHIP_VARIANT:=npcx9m3f
lisbon/build.mk:CHIP_VARIANT:=npcx9m3f
marasov/build.mk:CHIP_VARIANT:=npcx9m3f
mithrax/build.mk:CHIP_VARIANT:=npcx9m3f
moli/build.mk:CHIP_VARIANT:=npcx9m3f
npcx9_evb/build.mk:# the IC is Nuvoton NPCX9 M-Series EC (npcx9m3f, npcx9m6f)
npcx9_evb/build.mk:# npcx9m3f - for npcx9 ec with 512 KByte internal flash, more RAM.
npcx9_evb/build.mk:CHIP_VARIANT:=npcx9m3f
omnigul/build.mk:CHIP_VARIANT:=npcx9m3f
osiris/build.mk:CHIP_VARIANT:=npcx9m3f
primus/build.mk:CHIP_VARIANT:=npcx9m3f
redrix/build.mk:CHIP_VARIANT:=npcx9m3f
taeko/build.mk:CHIP_VARIANT:=npcx9m3f
taniks/build.mk:CHIP_VARIANT:=npcx9m3f
vell/build.mk:CHIP_VARIANT:=npcx9m3f
volmar/build.mk:CHIP_VARIANT:=npcx9m3f
James3
November 16, 2024, 11:47pm
6
Hi,
Also, trying to find “/opt/coreboot-sdk/bin/arm-eabi-gcc” on ubuntu.
Does anyone know where I download that from or which package it is contained in?
I.e. how do I install coreboot-sdk ?
DHowett
November 17, 2024, 3:45am
7
This may help you. It is a self-contained guide for building the Zephyr-based Azalea and Lotus EC firmware.
doc.md
## Prepare the OS
This assumes Debian. Make sure you have the `contrib` component enabled if you're using Debian. If you're not, you'll need equivalents of these packages.
```bash
apt install -yy repo swig build-essential python3-dev device-tree-compiler cmake file ninja-build python3.11-venv wget
```
## Prepare git
This file has been truncated. show original
framework.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="cros"
fetch="https://chromium.googlesource.com"
review="https://chromium-review.googlesource.com">
<annotation name="public" value="true" />
</remote>
<remote name="chromium"
alias="cros"
fetch="https://chromium.googlesource.com/">
This file has been truncated. show original
James3
November 19, 2024, 12:29am
8
I did the build process and have a “ec.bin” file.
When I backup the firmware from the current EC, it does not match the zmake ec.bin.
Is there any way to compile the ec.bin file so that it looks more like the backed up copy?
I wish to minimize the likelihood of bricking the laptop.
Has anyone tried “ram booting” the EC via the CCD serial port?
Much like one can do with pretty much all ARM based devices.
If I could RAM boot it, it would be much easier to experiment with.
DHowett
November 19, 2024, 2:18am
9
Unfortunately, no. I do not believe the builds are reproduceable. I’m also not certain of a way to boot from RAM; there’s a monitor but my understanding is that it just writes directly to flash.
However, the EC in the AMD 13” and 16” laptops supports booting from the RW firmware.
If you reflash only the RW region, you can boot it to test your changes and it will fall back to RO if it crashes.
If you’re using my ECTool.efi, you can…
ectool.efi reflash --rw fs0:\ec.bin
ectool.efi reboot rw