Commit Graph

35 Commits

Author SHA1 Message Date
Tim Crawford
498508f2f1 scripts: Disable showing signature when getting date
Fixes building when `log.showSignature` is enabled.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-04 13:48:35 -06:00
Tim Crawford
623d3ce8ab make: Add new targets
- fmt: Apply clang-format
- list-boards: list of available build targets
- help: Short description of make targets

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
Tim Crawford
58f9ed4051 Run lints at pre-commit
Install a hook to run lints at pre-commit to force issues to be fixed
during development.

This introduces a 5-10 second delay when committing due to how slow
clang-format is.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
Tim Crawford
1aadc68257 scripts: Rewrite lint scripts
Rewrite lint scripts to report what they do and if they pass. In the
case they fail list the files that caused the failure, except for
clang-format, which will be slow to run of every file individually
(should just run `make fmt` anyway). Also add a script to run all the
lints in order with a single command.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
Tim Crawford
b03c960b4f make: Reduce build output
Default to silent builds, only outputting the file being generated. This
gives output similar to Linux/coreboot output when building. `VERBOSE=1`
can be passed to show the actual commands.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 12:18:31 -07:00
Tim Crawford
2056d4d5e0 make: Disable built-in rules and variables
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 12:18:31 -07:00
Tim Crawford
9a52042f95 Generate and use compiler dep rules
SDCC supports the `-MMD` option. Use it instead of having every file
depend on *all* the headers. Reduces incremental build time after
modifying headers as it will now only rebuild the actual dependents and
not the entire project.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 12:18:31 -07:00
Tim Crawford
28882975e3 make: Ensure git hash is 7 characters
Specify abbrev so the version string is the same across systems with
different values for core.abbrev.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-13 12:01:49 -07:00
Tim Crawford
861f1f2cc8 make: Add config for each ITE EC
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.
2022-11-17 14:19:39 -07:00
Tim Crawford
ac9631f948 make: Specify source files to include
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>
2022-11-17 14:19:39 -07:00
Tim Crawford
ce66685c70 make: Move arch.mk to toolchain.mk
The arch.mk file contains variables/rules to build, so rename it. Leave
an empty arch.mk so it can still be used in a follow-up commit.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-17 14:19:39 -07:00
Tim Crawford
69f97fe149 Merge common EC directories
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>
2022-10-27 09:42:45 -06:00
Tim Crawford
cd8e76420d Add EC define that is usable in macros
The `__EC__` define is not usable in macros for conditional compilation.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-07-16 13:34:56 -06:00
Tim Crawford
5fd9df0ed0 Add SPDX license identifiers
Add license information to files. Mostly automated with:

    find src/ -name '*.[c,h]' | xargs sed -i '1s,^,// SPDX-License-Identifier: GPL-3.0-only\n\n,'
    find src/ -name '*.mk' | xargs sed -i '1s,^,# SPDX-License-Identifier: GPL-3.0-only\n\n,'
2020-09-17 09:17:08 -06:00
Jeremy Soller
357fae86fc System76 common board directory (#53)
* Move configuration for battery into board.mk

* lemp9: remove tcpm code

* Move touchpad to its own module

* Add kbled_reset to all platforms, move items to run on CPU reset to a function

* Add defines for battery and charger address

* Add I2C_0 export to it5570e

* Move common system76 board functions into src/board/system76/common
2020-04-14 17:23:29 -06:00
Jeremy Soller
8559f6f48a Allow clean to be run without BOARD being set 2020-04-07 12:13:06 -06:00
Tim Crawford
dfe3032f4d make: Move clean target above BOARD check 2020-04-07 11:41:26 -06:00
Tim Crawford
2a86572f2b Allow overriding version
In order to use the same version as the board firmware we need to be
able to specify the version string for the EC.

Ref: https://github.com/system76/firmware-open/issues/75
2020-04-07 08:01:16 -06:00
Jeremy Soller
20d3808aed Allow a config.mk to be created that contains BOARD, KEYMAP, etc. 2020-04-04 13:01:13 -06:00
Jeremy Soller
f7453df299 Fix compilation on AVR 2020-02-18 15:35:41 -07:00
Jeremy Soller
81ffcf5ae1 Add version to firmware image 2020-02-16 12:24:02 -07:00
Jeremy Soller
31eca35b40 Require board to be set 2020-02-06 13:06:13 -07:00
Jeremy Soller
bc13ddbbe2 Default to lemp9 2020-01-12 20:19:47 -07:00
Jeremy Soller
1ecae5e9f9 Rebuild when makefile change 2019-11-24 12:13:43 -07:00
Jeremy Soller
2db0b8c36a Move common directory, add defines for BOARD, EC, and ARCH 2019-09-30 17:35:13 -06:00
Jeremy Soller
3fb1ecd84b Add PWM control 2019-09-30 09:02:53 -06:00
Jeremy Soller
5c3fb062fd Add arduino uno readme 2019-09-29 21:26:21 -06:00
Jeremy Soller
9d056547e6 Add includes from each directory 2019-09-29 20:09:42 -06:00
Jeremy Soller
2fa764e879 Rename Arduino Mega 2560 board 2019-09-29 17:13:59 -06:00
Jeremy Soller
b04352cb63 Reorganize to allow compiling and running AVR firmware 2019-09-29 17:13:31 -06:00
Jeremy Soller
608326af30 Prepare for portable build process 2019-09-29 16:45:12 -06:00
Jeremy Soller
b479defcc4 Refactor timers, add GPIO debugging, and increase print speed 2019-09-27 21:04:59 -06:00
Jeremy Soller
da40506f04 Add simulation 2019-09-27 17:33:06 -06:00
Jeremy Soller
ffd9e6eca2 Modularize 2019-09-27 17:23:32 -06:00
Jeremy Soller
e97175932f Add initial source 2019-09-27 17:02:51 -06:00