diff options
35 files changed, 163 insertions, 17 deletions
diff --git a/.editorconfig b/.editorconfig index d029f52..fa5f176 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,8 @@ +# .editorconfig - How files in sbc_harness should be formatted +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later + root = true [*] @@ -1,3 +1,8 @@ +# .gitignore - Which files to ignore +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later + *.o *.log .mypy_cache/ diff --git a/.gitmodules b/.gitmodules index f54eb7f..ae5caf3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,8 @@ +# .gitmodules - Were to get some 3rd-party sources +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later + [submodule "3rd-party/pico-sdk"] path = 3rd-party/pico-sdk url = https://github.com/raspberrypi/pico-sdk diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e11d52..83341d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# CMakeLists.txt - Main build script for sbc-harness project +# CMakeLists.txt - Main per-output build script for sbc-harness project # # Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> # SPDX-Licence-Identifier: AGPL-3.0-or-later @@ -1,3 +1,10 @@ +<!-- + HACKING.md - Description of sbc-harness sources + + Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + SPDX-Licence-Identifier: AGPL-3.0-or-later +--> + Source layout - cmd/sbc_harness @@ -7,4 +14,3 @@ Source layout - libnet - TODO - lib9p - A simple 9P protocol server library - libusb - TODO - @@ -1,3 +1,8 @@ +# Makefile - Main build script for sbc-harness project +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later + linux.git = $(HOME)/src/github.com/torvalds/linux all: build @@ -54,6 +59,21 @@ lint: mypy --strict --scripts-are-modules $(sources_py) black --check $(sources_py) isort --check $(sources_py) + r=0; find $$(git ls-files -- $(foreach f,$(generate/files),:!$f) :!cmd/*/static/*) -maxdepth 0 -type f | while read -r filename; do \ + grep -q 'Copyright (C) 2024 Luke T. Shumaker' $$filename || \ + { echo "$$filename is missing a copyright statement"; r=1; continue; }; \ + dscname=$$(sed -n '1,3{ /^#!/d; /^<!--$$/d; /-\*- .* -\*-/d; s,[/*# ]*,,; s/ - .*//;p; q; }' $$filename); \ + filename_alt1=$$(echo "$$filename" | sed \ + -e 's,^cmd/,,' \ + -e 's,.*/include/,,' \ + -e 's,^lib9p/idl/,,' \ + -e 's/\.wip$$//'); \ + filename_alt2=$$(echo "$$filename_alt1" | sed \ + -e 's,^sbc_harness/,,' \ + -e 's,^srv9p/,,'); \ + [ "$$dscname" == "$$filename" ] || [ "$$dscname" == "$$filename_alt1" ] || [ "$$dscname" == "$$filename_alt2" ] || \ + { echo "$$filename self-identifies as $$dscname"; r=1; continue; }; \ + done; exit $$r format: black $(sources_py) isort $(sources_py) @@ -1,3 +1,10 @@ +<!-- + PLAN.md - Misc planning notes + + Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + SPDX-Licence-Identifier: AGPL-3.0-or-later +--> + - with hardware I have: 1. [X] type "hello world" as a USB keyboard 2. [ ] get networking up (ping) @@ -1,3 +1,10 @@ +<!-- + README.md - Description of sbc-harness + + Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + SPDX-Licence-Identifier: AGPL-3.0-or-later +--> + # Building Building requires cmake, make, an "arm-none-eabi" toolchain (including diff --git a/cmd/sbc_harness/config/config.h b/cmd/sbc_harness/config/config.h index f12d4e5..4817bf8 100644 --- a/cmd/sbc_harness/config/config.h +++ b/cmd/sbc_harness/config/config.h @@ -1,4 +1,4 @@ -/* config.h - Compile-time configuration for sbc_harness +/* sbc_harness/config/config.h - Compile-time configuration for sbc_harness * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/cmd/sbc_harness/config/tusb_config.h b/cmd/sbc_harness/config/tusb_config.h index 0eb1c9d..74561f3 100644 --- a/cmd/sbc_harness/config/tusb_config.h +++ b/cmd/sbc_harness/config/tusb_config.h @@ -1,9 +1,12 @@ -/* tusb_config.h - Compile-time configuration for the TinyUSB library +/* sbc_harness/config/tusb_config.h - Compile-time configuration for the TinyUSB library * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + * + * SPDX-Licence-Identifier: MIT * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org) - * Copyright (c) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/cmd/sbc_harness/hw/rp2040_hwspi.c b/cmd/sbc_harness/hw/rp2040_hwspi.c index 7019954..e6e4566 100644 --- a/cmd/sbc_harness/hw/rp2040_hwspi.c +++ b/cmd/sbc_harness/hw/rp2040_hwspi.c @@ -1,4 +1,8 @@ -/* rp2040_hwspi.c - `struct spi` implementation for the RP2040's ARM Primecell SSP (PL022) +/* hw/rp2040_hwspi.c - `struct spi` implementation for the RP2040's + * ARM Primecell SSP (PL022) (implementation file) + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later */ #include <assert.h> diff --git a/cmd/sbc_harness/hw/rp2040_hwspi.h b/cmd/sbc_harness/hw/rp2040_hwspi.h index 55a6759..8793fd6 100644 --- a/cmd/sbc_harness/hw/rp2040_hwspi.h +++ b/cmd/sbc_harness/hw/rp2040_hwspi.h @@ -1,3 +1,10 @@ +/* hw/rp2040_hwspi.h - `struct spi` implementation for the RP2040's + * ARM Primecell SSP (PL022) (header file) + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _RP2040_HWSPI_H_ #define _RP2040_HWSPI_H_ diff --git a/cmd/sbc_harness/hw/spi.h b/cmd/sbc_harness/hw/spi.h index c5a5603..86b831e 100644 --- a/cmd/sbc_harness/hw/spi.h +++ b/cmd/sbc_harness/hw/spi.h @@ -1,3 +1,9 @@ +/* hw/spi.h - Generic SPI definitions + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _HW_SPI_H_ #define _HW_SPI_H_ diff --git a/cmd/sbc_harness/hw/w5500.c b/cmd/sbc_harness/hw/w5500.c index 7bb9895..e32c589 100644 --- a/cmd/sbc_harness/hw/w5500.c +++ b/cmd/sbc_harness/hw/w5500.c @@ -1,8 +1,14 @@ -/* +/* hw/w5500.c - libnet implementation for the WIZnet W5500 chip + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + * * https://github.com/Wiznet/ioLibrary_Driver/blob/b981401e7f3d07015619adf44c13998e13e777f9/Ethernet/wizchip_conf.c * https://github.com/Wiznet/ioLibrary_Driver/blob/b981401e7f3d07015619adf44c13998e13e777f9/Ethernet/W5500/w5500.h * https://github.com/Wiznet/ioLibrary_Driver/blob/b981401e7f3d07015619adf44c13998e13e777f9/socket.c * + * SPDX-Licence-Identifier: BSD-3-Clause + * * Copyright (c) 2013, WIZnet Co., LTD. * All rights reserved. * diff --git a/cmd/sbc_harness/hw/w5500.h b/cmd/sbc_harness/hw/w5500.h index 967a436..bb629c5 100644 --- a/cmd/sbc_harness/hw/w5500.h +++ b/cmd/sbc_harness/hw/w5500.h @@ -1,3 +1,9 @@ +/* hw/w5500.h - libnet implementation for the WIZnet W5500 chip + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _HW_W5500_H_ #define _HW_W5500_H_ diff --git a/cmd/srv9p/config/config.h b/cmd/srv9p/config/config.h index 0f6c37e..fa6faeb 100644 --- a/cmd/srv9p/config/config.h +++ b/cmd/srv9p/config/config.h @@ -1,4 +1,4 @@ -/* config.h - Compile-time configuration for srv9p +/* srv9p/config/config.h - Compile-time configuration for srv9p * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/cmd/srv9p/gnet.h b/cmd/srv9p/gnet.h index 549dd7b..341ccd2 100644 --- a/cmd/srv9p/gnet.h +++ b/cmd/srv9p/gnet.h @@ -1,4 +1,4 @@ -/* gnet.c - libnet implementation for libcr + GNU libc +/* gnet.h - libnet implementation for libcr + GNU libc * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index 4170b5d..ae0e34e 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -1,3 +1,9 @@ +/* srv9p/main.c - Main entry point for test 9P server + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #include <error.h> #include <stdio.h> diff --git a/cmd/srv9p/static.h.gen b/cmd/srv9p/static.h.gen index 1c4d7b1..bb27e55 100755 --- a/cmd/srv9p/static.h.gen +++ b/cmd/srv9p/static.h.gen @@ -1,4 +1,8 @@ #!/bin/sh +# static.h.gen - Generate C definitions for GNU `ld -r -b binary` files +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later nm --format=posix "$@" | sed -n -E \ diff --git a/cmd/srv9p/static9p.c b/cmd/srv9p/static9p.c index e20921d..f508ff1 100644 --- a/cmd/srv9p/static9p.c +++ b/cmd/srv9p/static9p.c @@ -1,3 +1,9 @@ +/* srv9p/static9p.c - Serve static files over 9P + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #include <assert.h> #include "static9p.h" diff --git a/cmd/srv9p/static9p.h b/cmd/srv9p/static9p.h index 2d77138..92f5909 100644 --- a/cmd/srv9p/static9p.h +++ b/cmd/srv9p/static9p.h @@ -1,3 +1,9 @@ +/* srv9p/static9p.h - Serve static files over 9P + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _STATIC9P_H_ #define _STATIC9P_H_ diff --git a/lib9o/include/lib9o/lib9o.h b/lib9o/include/lib9o/lib9o.h index ed22293..f5eb511 100644 --- a/lib9o/include/lib9o/lib9o.h +++ b/lib9o/include/lib9o/lib9o.h @@ -1,4 +1,4 @@ -/* lib9o.h - A simple Go-ish object system built on GCC -fplan9-extensions +/* lib9o/lib9o.h - A simple Go-ish object system built on GCC -fplan9-extensions * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/lib9p/.editorconfig b/lib9p/.editorconfig index 5243d26..e3ef174 100644 --- a/lib9p/.editorconfig +++ b/lib9p/.editorconfig @@ -1,3 +1,8 @@ +# lib9p/.editorconfig - How Python scripts should be formatted +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later + [{idl.gen,linux-errno.h.gen}] indent_style = space indent_size = 4 diff --git a/lib9p/CMakeLists.txt b/lib9p/CMakeLists.txt index 63469d9..784397b 100644 --- a/lib9p/CMakeLists.txt +++ b/lib9p/CMakeLists.txt @@ -1,4 +1,4 @@ -# libcr/CMakeLists.txt - TODO +# lib9p/CMakeLists.txt - TODO # # Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> # SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/lib9p/idl/0000-README.md b/lib9p/idl/0000-README.md index f53acf9..be63943 100644 --- a/lib9p/idl/0000-README.md +++ b/lib9p/idl/0000-README.md @@ -1,9 +1,12 @@ -# 9P protocol definitions <!-- + 0000-README.md - Overview of 9P protocol definitions + Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> SPDX-Licence-Identifier: AGPL-3.0-or-later --> +# 9P protocol definitions + This directory contains several `*.9p` files, each of which describes a 9P protocol variant. diff --git a/lib9p/include/lib9p/linux-errno.h.gen b/lib9p/include/lib9p/linux-errno.h.gen index 7f0f67c..c757dcc 100755 --- a/lib9p/include/lib9p/linux-errno.h.gen +++ b/lib9p/include/lib9p/linux-errno.h.gen @@ -1,4 +1,8 @@ #!/usr/bin/env python +# lib9p/linux-errno.h.gen - Generate a C header from a list of errno numbers +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later import sys diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h index 284888f..91663e7 100644 --- a/lib9p/include/lib9p/srv.h +++ b/lib9p/include/lib9p/srv.h @@ -1,3 +1,9 @@ +/* lib9p/srv.h - 9P server + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _LIB9P_SRV_H_ #define _LIB9P_SRV_H_ diff --git a/lib9p/srv.c b/lib9p/srv.c index 282cd68..90791f3 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -1,3 +1,9 @@ +/* lib9p/srv.c - 9P server + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #include <assert.h> #include <alloca.h> #include <inttypes.h> /* for PRI* */ diff --git a/libcr/coroutine.c b/libcr/coroutine.c index e01d44c..37a5b1f 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -1,4 +1,4 @@ -/* coroutine.c - Simple embeddable coroutine implementation +/* libcr/coroutine.c - Simple embeddable coroutine implementation * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/libnet/include/libnet/libnet.h b/libnet/include/libnet/libnet.h index 4145f8b..022e922 100644 --- a/libnet/include/libnet/libnet.h +++ b/libnet/include/libnet/libnet.h @@ -1,3 +1,9 @@ +/* libnet/libnet.h - Base definitions for network interfaces + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _NETIO_H_ #define _NETIO_H_ diff --git a/libusb/include/libusb/tusb_helpers.h b/libusb/include/libusb/tusb_helpers.h index 2a6ee3c..a250ca7 100644 --- a/libusb/include/libusb/tusb_helpers.h +++ b/libusb/include/libusb/tusb_helpers.h @@ -1,7 +1,7 @@ /* Generated by `./libusb/include/libusb/tusb_helpers.h.gen `. DO NOT EDIT! */ /* libusb/tusb_helpers.h - Preprocessor macros that I think should be included in TinyUSB * - * Copyright (c) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * * SPDX-License-Identifier: MIT * diff --git a/libusb/include/libusb/tusb_helpers.h.gen b/libusb/include/libusb/tusb_helpers.h.gen index 364430e..326ca22 100755 --- a/libusb/include/libusb/tusb_helpers.h.gen +++ b/libusb/include/libusb/tusb_helpers.h.gen @@ -1,12 +1,13 @@ #!/usr/bin/env bash # -*- Mode: C -*- +# libusb/tusb_helpers.h.gen - Preprocessor macros that I think should be included in TinyUSB set -e exec >"${0%.gen}" echo "/* Generated by \`$0 $*\`. DO NOT EDIT! */" cat <<'EOT' /* libusb/tusb_helpers.h - Preprocessor macros that I think should be included in TinyUSB * - * Copyright (c) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * * SPDX-License-Identifier: MIT * diff --git a/libusb/include/libusb/usb_common.h b/libusb/include/libusb/usb_common.h index 33308d2..7a57c7c 100644 --- a/libusb/include/libusb/usb_common.h +++ b/libusb/include/libusb/usb_common.h @@ -1,4 +1,4 @@ -/* usb_common.h - Common framework for implementing multiple USB devices at once +/* libusb/usb_common.h - Common framework for implementing multiple USB devices at once * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later diff --git a/libusb/usb_common.c b/libusb/usb_common.c index b938247..18eb048 100644 --- a/libusb/usb_common.c +++ b/libusb/usb_common.c @@ -1,4 +1,4 @@ -/* usb_common.c - Common framework for implementing multiple USB devices at once +/* libusb/usb_common.c - Common framework for implementing multiple USB devices at once * * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-Licence-Identifier: AGPL-3.0-or-later @@ -1,3 +1,9 @@ +<!-- + notes.md - Misc notes + + Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + SPDX-Licence-Identifier: AGPL-3.0-or-later +--> Which file to include: |