This is more descriptive than the comment and allows for changing
values, such as using a chip with a different clock frequency.
The resulting binary is identical.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
The upcoming addw4 will use the IT5570E-256, which requires removing the
assumption that every ITE chip is 128K. Introduce new configs so boards
may select which flash size they use.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Groups 1, 3, and 4 require explicitly enabling the wake-up function
before unmasking them in INTC.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.
There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
A board may use either the LPC bus or the eSPI bus. Only include eSPI
support for boards that use it.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
EC_VARIANT is only used on AVR as a parameter to avrdude.
Replace its use on ITE with 2 choices:
- CONFIG_EC_ITE_IT8587E
- CONFIG_EC_ITE_IT5570E
Replace the EC defines with a matching define for the variable.
Replace use of wildcard with list of source files to include. The `-y`
suffix is added, but has no significance since conditional compilation
has not been added yet.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Split the EC define into base and variant. Merge the 3 ATmega chips as
atmega, and the 2 ITE chips as ite.
Tested that the generated files are identical.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Add IT5570E register that controls when the down counters are updated.
Set them to update when they reach 0, instead of immediately when DCRi
is written.
Fixes keyboard color changing when changing brightness levels if not
using 0xFF for an RGB value.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Replace bare int types with stdint types. This was done with:
grep -rwl 'int' src/ | xargs sed -i 's/\<int\>/int16_t/g'
grep -rwl 'unsigned long' src/ | xargs sed -i 's/\<unsigned long\>/uint32_t/g'
grep -rwl 'unsigned char' src/ | xargs sed -i 's/\<unsigned char\>/uint8_t/g'
Then reverted for *main(), putchar(), and getchar().
The Arduino declarations for parallel_main() were also corrected to
match their definitions.
SDCC does *not* generate the same code in all instances, due to `int`
being treated different than `short int`.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Most of the code is the same between IT8587E and IT5570E.
Identical files were detected with:
diff -rs src/ec/it8587e/ src/ec/it5570e/ | egrep '^Files .+ and .+ are identical$'
Then manually moved from one variant and deleted from the other.
Signed-off-by: Tim Crawford <tcrawford@system76.com>