[PATCH 3/3] build: Modularize the aarch64/raspberrypi spec

Utkarsh Verma utkarsh at bitbanged.com
Tue Aug 8 03:06:16 UTC 2023


---
 spec/build/bsps/aarch64/raspberrypi/abi.yml   | 39 ++++++----
 spec/build/bsps/aarch64/raspberrypi/bsp4b.yml | 23 ++++++
 .../aarch64/raspberrypi/bspraspberrypi4.yml   | 75 -------------------
 spec/build/bsps/aarch64/raspberrypi/grp.yml   | 25 +++++++
 spec/build/bsps/aarch64/raspberrypi/grp4b.yml | 26 +++++++
 .../{linkercmds.yml => linkcmds.yml}          | 27 ++++---
 spec/build/bsps/aarch64/raspberrypi/obj.yml   | 40 ++++++++++
 .../bsps/aarch64/raspberrypi/objcache.yml     | 23 ++++++
 .../bsps/aarch64/raspberrypi/objclock.yml     | 24 ++++++
 .../bsps/aarch64/raspberrypi/objconsole.yml   | 20 +++++
 .../build/bsps/aarch64/raspberrypi/objirq.yml | 27 +++++++
 .../bsps/aarch64/raspberrypi/objstart.yml     | 35 +++++++++
 12 files changed, 285 insertions(+), 99 deletions(-)
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/bsp4b.yml
 delete mode 100644 spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/grp.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/grp4b.yml
 rename spec/build/bsps/aarch64/raspberrypi/{linkercmds.yml => linkcmds.yml} (88%)
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/obj.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/objcache.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/objclock.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/objconsole.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/objirq.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/objstart.yml

diff --git a/spec/build/bsps/aarch64/raspberrypi/abi.yml b/spec/build/bsps/aarch64/raspberrypi/abi.yml
index 38a8d8bc8f..0e365f0146 100644
--- a/spec/build/bsps/aarch64/raspberrypi/abi.yml
+++ b/spec/build/bsps/aarch64/raspberrypi/abi.yml
@@ -1,19 +1,28 @@
 SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-actions:
-- get-string: null
-- split: null
-- env-append: null
-build-type: option
 copyrights:
-- Copyright (C) 2022 Mohd Noor Aman
-default:
-- enabled-by: true
-  value:
-  - -mcpu=cortex-a72
-  - -march=armv8-a
-description: |
-  ABI flags
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
 enabled-by: true
-links: []
+
+build-type: option
 name: ABI_FLAGS
-type: build
+description: ABI flags
+
+actions:
+  - get-string: null
+  - split: null
+  - env-append: null
+
+default:
+  - enabled-by:
+      - aarch64/raspberrypi4b
+    value:
+      - -mcpu=cortex-a72
+      - -march=armv8-a
+      - -mstrict-align
+
+links:
+  - role: build-dependency
+    uid: ../../opto2
diff --git a/spec/build/bsps/aarch64/raspberrypi/bsp4b.yml b/spec/build/bsps/aarch64/raspberrypi/bsp4b.yml
new file mode 100644
index 0000000000..058f97d1eb
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/bsp4b.yml
@@ -0,0 +1,23 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: bsp
+arch: aarch64
+bsp: raspberrypi4b
+family: raspberrypi
+cflags: []
+cppflags: []
+includes: []
+install: []
+source: []
+
+links:
+  - role: build-dependency
+    uid: grp4b
+  - role: build-dependency
+    uid: linkcmds
diff --git a/spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml b/spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
deleted file mode 100644
index d49e12a7f0..0000000000
--- a/spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-arch: aarch64
-bsp: raspberrypi4b
-build-type: bsp
-cflags: []
-copyrights:
-- Copyright (C) 2022 Mohd Noor Aman
-cppflags: []
-enabled-by: true
-family: raspberrypi
-includes: []
-install:
-- destination: ${BSP_INCLUDEDIR}
-  source:
-  - bsps/aarch64/raspberrypi/include/bsp.h
-  - bsps/aarch64/raspberrypi/include/tm27.h
-- destination: ${BSP_INCLUDEDIR}/bsp
-  source:
-  - bsps/aarch64/raspberrypi/include/bsp/irq.h
-  - bsps/aarch64/raspberrypi/include/bsp/bcm2711.h
-- destination: ${BSP_INCLUDEDIR}/bsp/start
-  source:
-  - bsps/aarch64/raspberrypi/include/bsp/start/bspstartmmu.h
-links:
-- role: build-dependency
-  uid: ../grp
-- role: build-dependency
-  uid: ../start
-- role: build-dependency
-  uid: ../optmmupages
-- role: build-dependency
-  uid: ../optgtusevirt
-- role: build-dependency
-  uid: ../optgtuseps
-- role: build-dependency
-  uid: abi
-- role: build-dependency
-  uid: ../../optcachedata
-- role: build-dependency
-  uid: ../../optcacheinst
-- role: build-dependency
-  uid: ../../opto2
-- role: build-dependency
-  uid: ../../bspopts
-- role: build-dependency
-  uid: linkercmds
-- role: build-dependency
-  uid: ../../obj
-- role: build-dependency
-  uid: ../../objirq
-source:
-- bsps/aarch64/raspberrypi/console/console.c
-- bsps/aarch64/raspberrypi/start/bspstart.c
-- bsps/aarch64/raspberrypi/start/bspstarthooks.c
-- bsps/aarch64/raspberrypi/start/bspstartmmu.c
-- bsps/aarch64/shared/clock/arm-generic-timer-aarch64.c
-- bsps/aarch64/shared/cache/cache.c
-- bsps/aarch64/shared/mmu/vmsav8-64.c
-- bsps/shared/dev/clock/arm-generic-timer.c
-- bsps/shared/dev/irq/arm-gicv2.c
-- bsps/shared/dev/irq/arm-gicv2-get-attributes.c
-- bsps/shared/dev/serial/console-termios-init.c
-- bsps/shared/dev/serial/console-termios.c
-- bsps/shared/dev/serial/arm-pl011.c
-- bsps/shared/dev/getentropy/getentropy-cpucounter.c
-- bsps/shared/dev/btimer/btimer-cpucounter.c
-- bsps/shared/irq/irq-default-handler.c
-- bsps/shared/start/bspfatal-default.c
-- bsps/shared/start/bspreset-arm-psci.c
-- bsps/shared/start/gettargethash-default.c
-- bsps/shared/start/sbrk.c
-- bsps/shared/start/wkspaceinitone.c
-- bsps/shared/start/mallocinitmulti.c
-- bsps/shared/start/bspgetworkarea-default.c
-type: build
diff --git a/spec/build/bsps/aarch64/raspberrypi/grp.yml b/spec/build/bsps/aarch64/raspberrypi/grp.yml
new file mode 100644
index 0000000000..65653b83f0
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/grp.yml
@@ -0,0 +1,25 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: group
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+install: []
+ldflags: []
+use-after: []
+use-before: []
+
+links:
+  - role: build-dependency
+    uid: abi
+  - role: build-dependency
+    uid: obj
+  - role: build-dependency
+    uid: ../grp
diff --git a/spec/build/bsps/aarch64/raspberrypi/grp4b.yml b/spec/build/bsps/aarch64/raspberrypi/grp4b.yml
new file mode 100644
index 0000000000..8a4b8c0370
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/grp4b.yml
@@ -0,0 +1,26 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: group
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+
+install:
+  - destination: ${BSP_INCLUDEDIR}/bsp
+    source:
+      - bsps/aarch64/raspberrypi/include/bsp/bcm2711.h
+
+ldflags: []
+use-after: []
+use-before: []
+
+links:
+  - role: build-dependency
+    uid: grp
diff --git a/spec/build/bsps/aarch64/raspberrypi/linkercmds.yml b/spec/build/bsps/aarch64/raspberrypi/linkcmds.yml
similarity index 88%
rename from spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
rename to spec/build/bsps/aarch64/raspberrypi/linkcmds.yml
index 701f9f935c..a2efa74bc1 100644
--- a/spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
+++ b/spec/build/bsps/aarch64/raspberrypi/linkcmds.yml
@@ -1,10 +1,19 @@
 SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
 build-type: config-file
+
 content: |
   /* SPDX-License-Identifier: BSD-2-Clause */
 
   /*
    * Copyright (C) 2022 Mohd Noor Aman
+   * Copyright (C) 2023 Utkarsh Verma
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
@@ -29,8 +38,8 @@ content: |
    */
 
   MEMORY {
-  RAM_MMU  : ORIGIN = 0x0, LENGTH = (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES})
-  RAM      : ORIGIN = 0x80000, LENGTH = 1024M
+    RAM_MMU  : ORIGIN = 0x0, LENGTH = (CONSTANT(COMMONPAGESIZE) * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES})
+    RAM      : ORIGIN = 0x80000, LENGTH = 1024M
   }
 
   REGION_ALIAS ("REGION_START",          RAM);
@@ -51,11 +60,11 @@ content: |
   REGION_ALIAS ("REGION_NOCACHE",        RAM);
   REGION_ALIAS ("REGION_NOCACHE_LOAD",   RAM);
 
-  bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 1024;
+  bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 1K;
 
   bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;
 
-  bsp_stack_exception_size = DEFINED (bsp_stack_exception_size) ? bsp_stack_exception_size : 1024;
+  bsp_stack_exception_size = DEFINED (bsp_stack_exception_size) ? bsp_stack_exception_size : 1K;
 
   bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;
 
@@ -67,10 +76,10 @@ content: |
   OUTPUT_ARCH (aarch64)
 
   INCLUDE linkcmds.base
-copyrights:
-- Copyright (C) 2022 Mohd Noor Aman
-enabled-by: true
+
 install-path: ${BSP_LIBDIR}
-links: []
 target: linkcmds
-type: build
+
+links:
+  - role: build-dependency
+    uid: ../optmmupages
diff --git a/spec/build/bsps/aarch64/raspberrypi/obj.yml b/spec/build/bsps/aarch64/raspberrypi/obj.yml
new file mode 100644
index 0000000000..f7f7c83147
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/obj.yml
@@ -0,0 +1,40 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: objects
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+
+install:
+  - destination: ${BSP_INCLUDEDIR}
+    source:
+      - bsps/aarch64/raspberrypi/include/bsp.h
+      - bsps/aarch64/raspberrypi/include/tm27.h
+
+source:
+  - bsps/aarch64/shared/mmu/vmsav8-64.c
+  - bsps/shared/dev/getentropy/getentropy-cpucounter.c
+  - bsps/shared/dev/btimer/btimer-cpucounter.c
+
+links:
+  - role: build-dependency
+    uid: objcache
+  - role: build-dependency
+    uid: objclock
+  - role: build-dependency
+    uid: objconsole
+  - role: build-dependency
+    uid: objirq
+  - role: build-dependency
+    uid: objstart
+  - role: build-dependency
+    uid: ../../obj
+  - role: build-dependency
+    uid: ../../bspopts
diff --git a/spec/build/bsps/aarch64/raspberrypi/objcache.yml b/spec/build/bsps/aarch64/raspberrypi/objcache.yml
new file mode 100644
index 0000000000..80621a2788
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/objcache.yml
@@ -0,0 +1,23 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: objects
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+install: []
+
+source:
+  - bsps/aarch64/shared/cache/cache.c
+
+links:
+  - role: build-dependency
+    uid: ../../optcachedata
+  - role: build-dependency
+    uid: ../../optcacheinst
diff --git a/spec/build/bsps/aarch64/raspberrypi/objclock.yml b/spec/build/bsps/aarch64/raspberrypi/objclock.yml
new file mode 100644
index 0000000000..a952567045
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/objclock.yml
@@ -0,0 +1,24 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: objects
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+install: []
+
+source:
+  - bsps/aarch64/shared/clock/arm-generic-timer-aarch64.c
+  - bsps/shared/dev/clock/arm-generic-timer.c
+
+links:
+  - role: build-dependency
+    uid: ../optgtusevirt
+  - role: build-dependency
+    uid: ../optgtuseps
diff --git a/spec/build/bsps/aarch64/raspberrypi/objconsole.yml b/spec/build/bsps/aarch64/raspberrypi/objconsole.yml
new file mode 100644
index 0000000000..f9b27b1622
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/objconsole.yml
@@ -0,0 +1,20 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: objects
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+install: []
+
+source:
+  - bsps/aarch64/raspberrypi/console/console.c
+  - bsps/shared/dev/serial/console-termios-init.c
+  - bsps/shared/dev/serial/console-termios.c
+
+links: []
diff --git a/spec/build/bsps/aarch64/raspberrypi/objirq.yml b/spec/build/bsps/aarch64/raspberrypi/objirq.yml
new file mode 100644
index 0000000000..7157b9c2c8
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/objirq.yml
@@ -0,0 +1,27 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: objects
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+
+install:
+  - destination: ${BSP_INCLUDEDIR}/bsp
+    source:
+      - bsps/aarch64/raspberrypi/include/bsp/irq.h
+
+source:
+  - bsps/shared/dev/irq/arm-gicv2.c
+  - bsps/shared/dev/irq/arm-gicv2-get-attributes.c
+  - bsps/shared/irq/irq-default-handler.c
+
+links:
+  - role: build-dependency
+    uid: ../../objirq
diff --git a/spec/build/bsps/aarch64/raspberrypi/objstart.yml b/spec/build/bsps/aarch64/raspberrypi/objstart.yml
new file mode 100644
index 0000000000..e9b0868b4c
--- /dev/null
+++ b/spec/build/bsps/aarch64/raspberrypi/objstart.yml
@@ -0,0 +1,35 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+  - Copyright (C) 2022 Mohd Noor Aman
+  - Copyright (C) 2023 Utkarsh Verma
+
+type: build
+enabled-by: true
+
+build-type: objects
+cflags: []
+cppflags: []
+cxxflags: []
+includes: []
+install:
+  - destination: ${BSP_INCLUDEDIR}/bsp/start
+    source:
+      - bsps/aarch64/raspberrypi/include/bsp/start/bspstartmmu.h
+
+source:
+  - bsps/aarch64/raspberrypi/start/bspstart.c
+  - bsps/aarch64/raspberrypi/start/bspstarthooks.c
+  - bsps/aarch64/raspberrypi/start/bspstartmmu.c
+  - bsps/shared/start/bspfatal-default.c
+  - bsps/shared/start/bspreset-arm-psci.c
+  - bsps/shared/start/gettargethash-default.c
+  - bsps/shared/start/sbrk.c
+  - bsps/shared/start/wkspaceinitone.c
+  - bsps/shared/start/mallocinitmulti.c
+  - bsps/shared/start/bspgetworkarea-default.c
+
+links:
+  - role: build-dependency
+    uid: ../start
+  - role: build-dependency
+    uid: ../optmmupages
-- 
2.41.0



More information about the devel mailing list