Where is "GPIO_TYPEC0_VBUS_ON_EC" defined?

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.

When building EC, which “board” should I select for the FW16 EC ?

It should be lotus IIRC.

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

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 ?

This may help you. It is a self-contained guide for building the Zephyr-based Azalea and Lotus EC firmware.

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.

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