From 0d6aad1a8c3b806716add4b5bb6954984d508ab3 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Wed, 19 Jun 2019 15:26:20 -0700 Subject: Delete coreip BSPs Signed-off-by: Nathaniel Graff --- bsp/coreip-e20-arty/README.md | 13 - bsp/coreip-e20-arty/design.dts | 187 ---- bsp/coreip-e20-arty/design.reglist | 214 ----- bsp/coreip-e20-arty/metal-inline.h | 261 ------ bsp/coreip-e20-arty/metal-platform.h | 163 ---- bsp/coreip-e20-arty/metal.default.lds | 234 ----- bsp/coreip-e20-arty/metal.h | 1020 ---------------------- bsp/coreip-e20-arty/metal.ramrodata.lds | 235 ------ bsp/coreip-e20-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-e20-arty/openocd.cfg | 30 - bsp/coreip-e20-arty/settings.mk | 13 - bsp/coreip-e20-rtl/README.md | 6 - bsp/coreip-e20-rtl/design.dts | 72 -- bsp/coreip-e20-rtl/design.reglist | 214 ----- bsp/coreip-e20-rtl/metal-inline.h | 132 --- bsp/coreip-e20-rtl/metal-platform.h | 47 -- bsp/coreip-e20-rtl/metal.default.lds | 233 ----- bsp/coreip-e20-rtl/metal.h | 467 ---------- bsp/coreip-e20-rtl/metal.ramrodata.lds | 230 ----- bsp/coreip-e20-rtl/metal.scratchpad.lds | 233 ----- bsp/coreip-e20-rtl/settings.mk | 15 - bsp/coreip-e21-arty/README.md | 14 - bsp/coreip-e21-arty/design.dts | 197 ----- bsp/coreip-e21-arty/design.reglist | 227 ----- bsp/coreip-e21-arty/metal-inline.h | 272 ------ bsp/coreip-e21-arty/metal-platform.h | 163 ---- bsp/coreip-e21-arty/metal.default.lds | 234 ----- bsp/coreip-e21-arty/metal.h | 1312 ----------------------------- bsp/coreip-e21-arty/metal.ramrodata.lds | 235 ------ bsp/coreip-e21-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-e21-arty/openocd.cfg | 30 - bsp/coreip-e21-arty/settings.mk | 13 - bsp/coreip-e21-rtl/README.md | 7 - bsp/coreip-e21-rtl/design.dts | 93 -- bsp/coreip-e21-rtl/design.reglist | 227 ----- bsp/coreip-e21-rtl/metal-inline.h | 154 ---- bsp/coreip-e21-rtl/metal-platform.h | 47 -- bsp/coreip-e21-rtl/metal.default.lds | 234 ----- bsp/coreip-e21-rtl/metal.h | 762 ----------------- bsp/coreip-e21-rtl/metal.ramrodata.lds | 235 ------ bsp/coreip-e21-rtl/metal.scratchpad.lds | 234 ----- bsp/coreip-e21-rtl/settings.mk | 15 - bsp/coreip-e24-arty/README.md | 13 - bsp/coreip-e24-arty/design.dts | 197 ----- bsp/coreip-e24-arty/design.reglist | 262 ------ bsp/coreip-e24-arty/metal-inline.h | 272 ------ bsp/coreip-e24-arty/metal-platform.h | 163 ---- bsp/coreip-e24-arty/metal.default.lds | 234 ----- bsp/coreip-e24-arty/metal.h | 1312 ----------------------------- bsp/coreip-e24-arty/metal.ramrodata.lds | 235 ------ bsp/coreip-e24-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-e24-arty/openocd.cfg | 30 - bsp/coreip-e24-arty/settings.mk | 13 - bsp/coreip-e24-rtl/README.md | 8 - bsp/coreip-e24-rtl/design.dts | 94 --- bsp/coreip-e24-rtl/design.reglist | 262 ------ bsp/coreip-e24-rtl/metal-inline.h | 154 ---- bsp/coreip-e24-rtl/metal-platform.h | 47 -- bsp/coreip-e24-rtl/metal.default.lds | 234 ----- bsp/coreip-e24-rtl/metal.h | 762 ----------------- bsp/coreip-e24-rtl/metal.ramrodata.lds | 235 ------ bsp/coreip-e24-rtl/metal.scratchpad.lds | 234 ----- bsp/coreip-e24-rtl/settings.mk | 15 - bsp/coreip-e31-arty/README.md | 14 - bsp/coreip-e31-arty/design.dts | 208 ----- bsp/coreip-e31-arty/design.reglist | 227 ----- bsp/coreip-e31-arty/metal-inline.h | 281 ------ bsp/coreip-e31-arty/metal-inline1.h | 44 - bsp/coreip-e31-arty/metal-platform.h | 166 ---- bsp/coreip-e31-arty/metal.default.lds | 234 ----- bsp/coreip-e31-arty/metal.h | 1027 ---------------------- bsp/coreip-e31-arty/metal.ramrodata.lds | 231 ----- bsp/coreip-e31-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-e31-arty/openocd.cfg | 30 - bsp/coreip-e31-arty/settings.mk | 13 - bsp/coreip-e31-rtl/README.md | 9 - bsp/coreip-e31-rtl/design.dts | 108 --- bsp/coreip-e31-rtl/design.reglist | 227 ----- bsp/coreip-e31-rtl/metal-inline.h | 173 ---- bsp/coreip-e31-rtl/metal-platform.h | 54 -- bsp/coreip-e31-rtl/metal.default.lds | 234 ----- bsp/coreip-e31-rtl/metal.h | 901 -------------------- bsp/coreip-e31-rtl/metal.ramrodata.lds | 231 ----- bsp/coreip-e31-rtl/metal.scratchpad.lds | 234 ----- bsp/coreip-e31-rtl/settings.mk | 15 - bsp/coreip-e34-arty/README.md | 14 - bsp/coreip-e34-arty/design.dts | 208 ----- bsp/coreip-e34-arty/design.reglist | 262 ------ bsp/coreip-e34-arty/metal-inline.h | 281 ------ bsp/coreip-e34-arty/metal-platform.h | 166 ---- bsp/coreip-e34-arty/metal.default.lds | 234 ----- bsp/coreip-e34-arty/metal.h | 1027 ---------------------- bsp/coreip-e34-arty/metal.ramrodata.lds | 231 ----- bsp/coreip-e34-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-e34-arty/openocd.cfg | 30 - bsp/coreip-e34-arty/settings.mk | 13 - bsp/coreip-e34-rtl/README.md | 9 - bsp/coreip-e34-rtl/design.dts | 108 --- bsp/coreip-e34-rtl/design.reglist | 262 ------ bsp/coreip-e34-rtl/metal-inline.h | 173 ---- bsp/coreip-e34-rtl/metal-platform.h | 54 -- bsp/coreip-e34-rtl/metal.default.lds | 234 ----- bsp/coreip-e34-rtl/metal.h | 901 -------------------- bsp/coreip-e34-rtl/metal.ramrodata.lds | 231 ----- bsp/coreip-e34-rtl/metal.scratchpad.lds | 234 ----- bsp/coreip-e34-rtl/settings.mk | 15 - bsp/coreip-e76-arty/README.md | 16 - bsp/coreip-e76-arty/design.dts | 216 ----- bsp/coreip-e76-arty/design.reglist | 262 ------ bsp/coreip-e76-arty/metal-inline.h | 266 ------ bsp/coreip-e76-arty/metal-platform.h | 168 ---- bsp/coreip-e76-arty/metal.default.lds | 234 ----- bsp/coreip-e76-arty/metal.h | 968 --------------------- bsp/coreip-e76-arty/metal.ramrodata.lds | 231 ----- bsp/coreip-e76-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-e76-arty/openocd.cfg | 30 - bsp/coreip-e76-arty/settings.mk | 13 - bsp/coreip-e76-rtl/README.md | 11 - bsp/coreip-e76-rtl/design.dts | 93 -- bsp/coreip-e76-rtl/design.reglist | 262 ------ bsp/coreip-e76-rtl/metal-inline.h | 142 ---- bsp/coreip-e76-rtl/metal-platform.h | 50 -- bsp/coreip-e76-rtl/metal.default.lds | 233 ----- bsp/coreip-e76-rtl/metal.h | 809 ------------------ bsp/coreip-e76-rtl/metal.ramrodata.lds | 230 ----- bsp/coreip-e76-rtl/metal.scratchpad.lds | 233 ----- bsp/coreip-e76-rtl/settings.mk | 15 - bsp/coreip-s51-arty/README.md | 14 - bsp/coreip-s51-arty/design.dts | 208 ----- bsp/coreip-s51-arty/design.reglist | 218 ----- bsp/coreip-s51-arty/metal-inline.h | 281 ------ bsp/coreip-s51-arty/metal-platform.h | 166 ---- bsp/coreip-s51-arty/metal.default.lds | 234 ----- bsp/coreip-s51-arty/metal.h | 1027 ---------------------- bsp/coreip-s51-arty/metal.ramrodata.lds | 231 ----- bsp/coreip-s51-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-s51-arty/openocd.cfg | 30 - bsp/coreip-s51-arty/settings.mk | 13 - bsp/coreip-s51-rtl/README.md | 9 - bsp/coreip-s51-rtl/design.dts | 108 --- bsp/coreip-s51-rtl/design.reglist | 218 ----- bsp/coreip-s51-rtl/metal-inline.h | 173 ---- bsp/coreip-s51-rtl/metal-platform.h | 54 -- bsp/coreip-s51-rtl/metal.default.lds | 234 ----- bsp/coreip-s51-rtl/metal.h | 901 -------------------- bsp/coreip-s51-rtl/metal.ramrodata.lds | 231 ----- bsp/coreip-s51-rtl/metal.scratchpad.lds | 234 ----- bsp/coreip-s51-rtl/settings.mk | 15 - bsp/coreip-s54-arty/README.md | 16 - bsp/coreip-s54-arty/design.dts | 208 ----- bsp/coreip-s54-arty/design.reglist | 253 ------ bsp/coreip-s54-arty/metal-inline.h | 281 ------ bsp/coreip-s54-arty/metal-platform.h | 166 ---- bsp/coreip-s54-arty/metal.default.lds | 234 ----- bsp/coreip-s54-arty/metal.h | 1027 ---------------------- bsp/coreip-s54-arty/metal.ramrodata.lds | 231 ----- bsp/coreip-s54-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-s54-arty/openocd.cfg | 30 - bsp/coreip-s54-arty/settings.mk | 13 - bsp/coreip-s54-rtl/README.md | 11 - bsp/coreip-s54-rtl/design.dts | 108 --- bsp/coreip-s54-rtl/design.reglist | 253 ------ bsp/coreip-s54-rtl/metal-inline.h | 173 ---- bsp/coreip-s54-rtl/metal-platform.h | 54 -- bsp/coreip-s54-rtl/metal.default.lds | 234 ----- bsp/coreip-s54-rtl/metal.h | 901 -------------------- bsp/coreip-s54-rtl/metal.ramrodata.lds | 231 ----- bsp/coreip-s54-rtl/metal.scratchpad.lds | 234 ----- bsp/coreip-s54-rtl/settings.mk | 15 - bsp/coreip-s76-arty/README.md | 16 - bsp/coreip-s76-arty/design.dts | 216 ----- bsp/coreip-s76-arty/design.reglist | 253 ------ bsp/coreip-s76-arty/metal-inline.h | 266 ------ bsp/coreip-s76-arty/metal-platform.h | 168 ---- bsp/coreip-s76-arty/metal.default.lds | 234 ----- bsp/coreip-s76-arty/metal.h | 968 --------------------- bsp/coreip-s76-arty/metal.ramrodata.lds | 231 ----- bsp/coreip-s76-arty/metal.scratchpad.lds | 234 ----- bsp/coreip-s76-arty/openocd.cfg | 30 - bsp/coreip-s76-arty/settings.mk | 13 - bsp/coreip-s76-rtl/README.md | 11 - bsp/coreip-s76-rtl/design.dts | 93 -- bsp/coreip-s76-rtl/design.reglist | 253 ------ bsp/coreip-s76-rtl/metal-inline.h | 142 ---- bsp/coreip-s76-rtl/metal-platform.h | 50 -- bsp/coreip-s76-rtl/metal.default.lds | 233 ----- bsp/coreip-s76-rtl/metal.h | 809 ------------------ bsp/coreip-s76-rtl/metal.ramrodata.lds | 230 ----- bsp/coreip-s76-rtl/metal.scratchpad.lds | 233 ----- bsp/coreip-s76-rtl/settings.mk | 15 - bsp/coreip-u54-rtl/README.md | 17 - bsp/coreip-u54-rtl/design.dts | 130 --- bsp/coreip-u54-rtl/metal-inline.h | 158 ---- bsp/coreip-u54-rtl/metal-platform.h | 60 -- bsp/coreip-u54-rtl/metal.default.lds | 233 ----- bsp/coreip-u54-rtl/metal.h | 827 ------------------ bsp/coreip-u54-rtl/metal.ramrodata.lds | 230 ----- bsp/coreip-u54-rtl/metal.scratchpad.lds | 233 ----- bsp/coreip-u54-rtl/settings.mk | 15 - bsp/coreip-u54mc-rtl/README.md | 23 - bsp/coreip-u54mc-rtl/design.dts | 291 ------- bsp/coreip-u54mc-rtl/metal-inline.h | 257 ------ bsp/coreip-u54mc-rtl/metal-platform.h | 60 -- bsp/coreip-u54mc-rtl/metal.default.lds | 237 ------ bsp/coreip-u54mc-rtl/metal.h | 1004 ---------------------- bsp/coreip-u54mc-rtl/metal.ramrodata.lds | 234 ----- bsp/coreip-u54mc-rtl/metal.scratchpad.lds | 237 ------ bsp/coreip-u54mc-rtl/settings.mk | 15 - 208 files changed, 47433 deletions(-) delete mode 100644 bsp/coreip-e20-arty/README.md delete mode 100644 bsp/coreip-e20-arty/design.dts delete mode 100644 bsp/coreip-e20-arty/design.reglist delete mode 100644 bsp/coreip-e20-arty/metal-inline.h delete mode 100644 bsp/coreip-e20-arty/metal-platform.h delete mode 100644 bsp/coreip-e20-arty/metal.default.lds delete mode 100644 bsp/coreip-e20-arty/metal.h delete mode 100644 bsp/coreip-e20-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-e20-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-e20-arty/openocd.cfg delete mode 100644 bsp/coreip-e20-arty/settings.mk delete mode 100644 bsp/coreip-e20-rtl/README.md delete mode 100644 bsp/coreip-e20-rtl/design.dts delete mode 100644 bsp/coreip-e20-rtl/design.reglist delete mode 100644 bsp/coreip-e20-rtl/metal-inline.h delete mode 100644 bsp/coreip-e20-rtl/metal-platform.h delete mode 100644 bsp/coreip-e20-rtl/metal.default.lds delete mode 100644 bsp/coreip-e20-rtl/metal.h delete mode 100644 bsp/coreip-e20-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-e20-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-e20-rtl/settings.mk delete mode 100644 bsp/coreip-e21-arty/README.md delete mode 100644 bsp/coreip-e21-arty/design.dts delete mode 100644 bsp/coreip-e21-arty/design.reglist delete mode 100644 bsp/coreip-e21-arty/metal-inline.h delete mode 100644 bsp/coreip-e21-arty/metal-platform.h delete mode 100644 bsp/coreip-e21-arty/metal.default.lds delete mode 100644 bsp/coreip-e21-arty/metal.h delete mode 100644 bsp/coreip-e21-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-e21-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-e21-arty/openocd.cfg delete mode 100644 bsp/coreip-e21-arty/settings.mk delete mode 100644 bsp/coreip-e21-rtl/README.md delete mode 100644 bsp/coreip-e21-rtl/design.dts delete mode 100644 bsp/coreip-e21-rtl/design.reglist delete mode 100644 bsp/coreip-e21-rtl/metal-inline.h delete mode 100644 bsp/coreip-e21-rtl/metal-platform.h delete mode 100644 bsp/coreip-e21-rtl/metal.default.lds delete mode 100644 bsp/coreip-e21-rtl/metal.h delete mode 100644 bsp/coreip-e21-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-e21-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-e21-rtl/settings.mk delete mode 100644 bsp/coreip-e24-arty/README.md delete mode 100644 bsp/coreip-e24-arty/design.dts delete mode 100644 bsp/coreip-e24-arty/design.reglist delete mode 100644 bsp/coreip-e24-arty/metal-inline.h delete mode 100644 bsp/coreip-e24-arty/metal-platform.h delete mode 100644 bsp/coreip-e24-arty/metal.default.lds delete mode 100644 bsp/coreip-e24-arty/metal.h delete mode 100644 bsp/coreip-e24-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-e24-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-e24-arty/openocd.cfg delete mode 100644 bsp/coreip-e24-arty/settings.mk delete mode 100644 bsp/coreip-e24-rtl/README.md delete mode 100644 bsp/coreip-e24-rtl/design.dts delete mode 100644 bsp/coreip-e24-rtl/design.reglist delete mode 100644 bsp/coreip-e24-rtl/metal-inline.h delete mode 100644 bsp/coreip-e24-rtl/metal-platform.h delete mode 100644 bsp/coreip-e24-rtl/metal.default.lds delete mode 100644 bsp/coreip-e24-rtl/metal.h delete mode 100644 bsp/coreip-e24-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-e24-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-e24-rtl/settings.mk delete mode 100644 bsp/coreip-e31-arty/README.md delete mode 100644 bsp/coreip-e31-arty/design.dts delete mode 100644 bsp/coreip-e31-arty/design.reglist delete mode 100644 bsp/coreip-e31-arty/metal-inline.h delete mode 100644 bsp/coreip-e31-arty/metal-inline1.h delete mode 100644 bsp/coreip-e31-arty/metal-platform.h delete mode 100644 bsp/coreip-e31-arty/metal.default.lds delete mode 100644 bsp/coreip-e31-arty/metal.h delete mode 100644 bsp/coreip-e31-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-e31-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-e31-arty/openocd.cfg delete mode 100644 bsp/coreip-e31-arty/settings.mk delete mode 100644 bsp/coreip-e31-rtl/README.md delete mode 100644 bsp/coreip-e31-rtl/design.dts delete mode 100644 bsp/coreip-e31-rtl/design.reglist delete mode 100644 bsp/coreip-e31-rtl/metal-inline.h delete mode 100644 bsp/coreip-e31-rtl/metal-platform.h delete mode 100644 bsp/coreip-e31-rtl/metal.default.lds delete mode 100644 bsp/coreip-e31-rtl/metal.h delete mode 100644 bsp/coreip-e31-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-e31-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-e31-rtl/settings.mk delete mode 100644 bsp/coreip-e34-arty/README.md delete mode 100644 bsp/coreip-e34-arty/design.dts delete mode 100644 bsp/coreip-e34-arty/design.reglist delete mode 100644 bsp/coreip-e34-arty/metal-inline.h delete mode 100644 bsp/coreip-e34-arty/metal-platform.h delete mode 100644 bsp/coreip-e34-arty/metal.default.lds delete mode 100644 bsp/coreip-e34-arty/metal.h delete mode 100644 bsp/coreip-e34-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-e34-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-e34-arty/openocd.cfg delete mode 100644 bsp/coreip-e34-arty/settings.mk delete mode 100644 bsp/coreip-e34-rtl/README.md delete mode 100644 bsp/coreip-e34-rtl/design.dts delete mode 100644 bsp/coreip-e34-rtl/design.reglist delete mode 100644 bsp/coreip-e34-rtl/metal-inline.h delete mode 100644 bsp/coreip-e34-rtl/metal-platform.h delete mode 100644 bsp/coreip-e34-rtl/metal.default.lds delete mode 100644 bsp/coreip-e34-rtl/metal.h delete mode 100644 bsp/coreip-e34-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-e34-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-e34-rtl/settings.mk delete mode 100644 bsp/coreip-e76-arty/README.md delete mode 100644 bsp/coreip-e76-arty/design.dts delete mode 100644 bsp/coreip-e76-arty/design.reglist delete mode 100644 bsp/coreip-e76-arty/metal-inline.h delete mode 100644 bsp/coreip-e76-arty/metal-platform.h delete mode 100644 bsp/coreip-e76-arty/metal.default.lds delete mode 100644 bsp/coreip-e76-arty/metal.h delete mode 100644 bsp/coreip-e76-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-e76-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-e76-arty/openocd.cfg delete mode 100644 bsp/coreip-e76-arty/settings.mk delete mode 100644 bsp/coreip-e76-rtl/README.md delete mode 100644 bsp/coreip-e76-rtl/design.dts delete mode 100644 bsp/coreip-e76-rtl/design.reglist delete mode 100644 bsp/coreip-e76-rtl/metal-inline.h delete mode 100644 bsp/coreip-e76-rtl/metal-platform.h delete mode 100644 bsp/coreip-e76-rtl/metal.default.lds delete mode 100644 bsp/coreip-e76-rtl/metal.h delete mode 100644 bsp/coreip-e76-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-e76-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-e76-rtl/settings.mk delete mode 100644 bsp/coreip-s51-arty/README.md delete mode 100644 bsp/coreip-s51-arty/design.dts delete mode 100644 bsp/coreip-s51-arty/design.reglist delete mode 100644 bsp/coreip-s51-arty/metal-inline.h delete mode 100644 bsp/coreip-s51-arty/metal-platform.h delete mode 100644 bsp/coreip-s51-arty/metal.default.lds delete mode 100644 bsp/coreip-s51-arty/metal.h delete mode 100644 bsp/coreip-s51-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-s51-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-s51-arty/openocd.cfg delete mode 100644 bsp/coreip-s51-arty/settings.mk delete mode 100644 bsp/coreip-s51-rtl/README.md delete mode 100644 bsp/coreip-s51-rtl/design.dts delete mode 100644 bsp/coreip-s51-rtl/design.reglist delete mode 100644 bsp/coreip-s51-rtl/metal-inline.h delete mode 100644 bsp/coreip-s51-rtl/metal-platform.h delete mode 100644 bsp/coreip-s51-rtl/metal.default.lds delete mode 100644 bsp/coreip-s51-rtl/metal.h delete mode 100644 bsp/coreip-s51-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-s51-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-s51-rtl/settings.mk delete mode 100644 bsp/coreip-s54-arty/README.md delete mode 100644 bsp/coreip-s54-arty/design.dts delete mode 100644 bsp/coreip-s54-arty/design.reglist delete mode 100644 bsp/coreip-s54-arty/metal-inline.h delete mode 100644 bsp/coreip-s54-arty/metal-platform.h delete mode 100644 bsp/coreip-s54-arty/metal.default.lds delete mode 100644 bsp/coreip-s54-arty/metal.h delete mode 100644 bsp/coreip-s54-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-s54-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-s54-arty/openocd.cfg delete mode 100644 bsp/coreip-s54-arty/settings.mk delete mode 100644 bsp/coreip-s54-rtl/README.md delete mode 100644 bsp/coreip-s54-rtl/design.dts delete mode 100644 bsp/coreip-s54-rtl/design.reglist delete mode 100644 bsp/coreip-s54-rtl/metal-inline.h delete mode 100644 bsp/coreip-s54-rtl/metal-platform.h delete mode 100644 bsp/coreip-s54-rtl/metal.default.lds delete mode 100644 bsp/coreip-s54-rtl/metal.h delete mode 100644 bsp/coreip-s54-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-s54-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-s54-rtl/settings.mk delete mode 100644 bsp/coreip-s76-arty/README.md delete mode 100644 bsp/coreip-s76-arty/design.dts delete mode 100644 bsp/coreip-s76-arty/design.reglist delete mode 100644 bsp/coreip-s76-arty/metal-inline.h delete mode 100644 bsp/coreip-s76-arty/metal-platform.h delete mode 100644 bsp/coreip-s76-arty/metal.default.lds delete mode 100644 bsp/coreip-s76-arty/metal.h delete mode 100644 bsp/coreip-s76-arty/metal.ramrodata.lds delete mode 100644 bsp/coreip-s76-arty/metal.scratchpad.lds delete mode 100644 bsp/coreip-s76-arty/openocd.cfg delete mode 100644 bsp/coreip-s76-arty/settings.mk delete mode 100644 bsp/coreip-s76-rtl/README.md delete mode 100644 bsp/coreip-s76-rtl/design.dts delete mode 100644 bsp/coreip-s76-rtl/design.reglist delete mode 100644 bsp/coreip-s76-rtl/metal-inline.h delete mode 100644 bsp/coreip-s76-rtl/metal-platform.h delete mode 100644 bsp/coreip-s76-rtl/metal.default.lds delete mode 100644 bsp/coreip-s76-rtl/metal.h delete mode 100644 bsp/coreip-s76-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-s76-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-s76-rtl/settings.mk delete mode 100644 bsp/coreip-u54-rtl/README.md delete mode 100644 bsp/coreip-u54-rtl/design.dts delete mode 100644 bsp/coreip-u54-rtl/metal-inline.h delete mode 100644 bsp/coreip-u54-rtl/metal-platform.h delete mode 100644 bsp/coreip-u54-rtl/metal.default.lds delete mode 100644 bsp/coreip-u54-rtl/metal.h delete mode 100644 bsp/coreip-u54-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-u54-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-u54-rtl/settings.mk delete mode 100644 bsp/coreip-u54mc-rtl/README.md delete mode 100644 bsp/coreip-u54mc-rtl/design.dts delete mode 100644 bsp/coreip-u54mc-rtl/metal-inline.h delete mode 100644 bsp/coreip-u54mc-rtl/metal-platform.h delete mode 100644 bsp/coreip-u54mc-rtl/metal.default.lds delete mode 100644 bsp/coreip-u54mc-rtl/metal.h delete mode 100644 bsp/coreip-u54mc-rtl/metal.ramrodata.lds delete mode 100644 bsp/coreip-u54mc-rtl/metal.scratchpad.lds delete mode 100644 bsp/coreip-u54mc-rtl/settings.mk (limited to 'bsp') diff --git a/bsp/coreip-e20-arty/README.md b/bsp/coreip-e20-arty/README.md deleted file mode 100644 index a10a36c..0000000 --- a/bsp/coreip-e20-arty/README.md +++ /dev/null @@ -1,13 +0,0 @@ -The SiFive E20 Standard Core is an extremely efficient implementation of the E2 Series configured for very low area and power. The E20 brings the power of the RISC-V software ecosystem to efficiently address traditional 8-bit and 32-bit microcontroller applications such as IoT, Analog Mixed Signal, and Programmable Finite State Machines. - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMC core -- 4 hardware breakpoints -- Up to 153 CLIC interrupt signals that can be connected to off core complex devices, with 16 levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches - diff --git a/bsp/coreip-e20-arty/design.dts b/bsp/coreip-e20-arty/design.dts deleted file mode 100644 index de47256..0000000 --- a/bsp/coreip-e20-arty/design.dts +++ /dev/null @@ -1,187 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE200G-dev", "fe200-dev", "sifive-dev"; - model = "SiFive,FE200G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L6 0x400000>; - }; - L15: aliases { - serial0 = &L5; - }; - L14: cpus { - #address-cells = <1>; - #size-cells = <0>; - L3: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,caboose0", "riscv"; - device_type = "cpu"; - reg = <0x0>; - riscv,isa = "rv32imc"; - status = "okay"; - timebase-frequency = <32000000>; - hardware-exec-breakpoint-count = <4>; - L2: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L13: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE200G-soc", "fe200-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L1: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L2 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L10: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L0>; - interrupts = <22 23 24 25>; - }; - L4: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L0>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L0: interrupt-controller@2000000 { - #interrupt-cells = <1>; - compatible = "sifive,clic0"; - interrupt-controller; - interrupts-extended = <&L2 3 &L2 7 &L2 11>; - reg = <0x2000000 0x1000000>; - reg-names = "control"; - sifive,numints = <58>; - sifive,numlevels = <16>; - sifive,numintbits = <2>; - }; - L11: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L0>; - interrupts = <26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57>; - }; - L7: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L0>; - interrupts = <18 19 20 21>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L5: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L0>; - interrupts = <16>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L6: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L0>; - interrupts = <17>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - L9: sys-sram-0@80000000 { - compatible = "sifive,sram0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L4 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L4 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L4 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L4 4>; - interrupts-extended = <&L11 20>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L4 5>; - interrupts-extended = <&L11 21>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L4 6>; - interrupts-extended = <&L11 22>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L4 7>; - interrupts-extended = <&L11 23>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L11 16>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L11 17>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L11 18>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L11 19>; - linux,code = "none"; - }; - L8: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-e20-arty/design.reglist b/bsp/coreip-e20-arty/design.reglist deleted file mode 100644 index 645819d..0000000 --- a/bsp/coreip-e20-arty/design.reglist +++ /dev/null @@ -1,214 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mscratch -mepc -mcause -mtval -mip -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e20-arty/metal-inline.h b/bsp/coreip-e20-arty/metal-inline.h deleted file mode 100644 index a9f2eb0..0000000 --- a/bsp/coreip-e20-arty/metal-inline.h +++ /dev/null @@ -1,261 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E20_ARTY__METAL_INLINE_H -#define COREIP_E20_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller); - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000 = { - .controller.vtable = &__metal_driver_vtable_sifive_clic0.clic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_E20_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e20-arty/metal-platform.h b/bsp/coreip-e20-arty/metal-platform.h deleted file mode 100644 index 1c8b88e..0000000 --- a/bsp/coreip-e20-arty/metal-platform.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E20_ARTY__METAL_PLATFORM_H -#define COREIP_E20_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From interrupt_controller@2000000 */ -#define METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_0_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_2000000_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_0_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS 58UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTS 58UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS 2UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTBITS 2UL - -#define METAL_SIFIVE_CLIC0 -#define METAL_SIFIVE_CLIC0_MSIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_MTIMECMP_BASE 16384UL -#define METAL_SIFIVE_CLIC0_MTIME 49144UL -#define METAL_SIFIVE_CLIC0_CLICINTIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_CLICINTIE_BASE 1024UL -#define METAL_SIFIVE_CLIC0_CLICINTCTL_BASE 2048UL -#define METAL_SIFIVE_CLIC0_CLICCFG 3072UL -#define METAL_SIFIVE_CLIC0_MMODE_APERTURE 8388608UL -#define METAL_SIFIVE_CLIC0_HSMODE_APERTURE 10485760UL -#define METAL_SIFIVE_CLIC0_SMODE_APERTURE 12582912UL -#define METAL_SIFIVE_CLIC0_UMODE_APERTURE 14680064UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_E20_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e20-arty/metal.default.lds b/bsp/coreip-e20-arty/metal.default.lds deleted file mode 100644 index 9b63276..0000000 --- a/bsp/coreip-e20-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :ram_init - - - .itim : - { - *(.itim .itim.*) - } >flash AT>flash :flash - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e20-arty/metal.h b/bsp/coreip-e20-arty/metal.h deleted file mode 100644 index cbfee11..0000000 --- a/bsp/coreip-e20-arty/metal.h +++ /dev/null @@ -1,1020 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E20_ARTY__METAL_H -#define MACROS_IF_COREIP_E20_ARTY__METAL_H - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#define __METAL_CLIC_SUBINTERRUPTS 58 - -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E20_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E20_ARTY__METAL_H -#define MACROS_ELSE_COREIP_E20_ARTY__METAL_H - -#define METAL_MAX_CLINT_INTERRUPTS 0 - -#define __METAL_CLINT_NUM_PARENTS 0 - -#define __METAL_PLIC_SUBINTERRUPTS 0 -#define METAL_MAX_PLIC_INTERRUPTS 0 - -#define __METAL_PLIC_NUM_PARENTS 0 - -#define __METAL_INTERRUPT_CONTROLLER_2000000_INTERRUPTS 3 - -#define __METAL_CLIC_SUBINTERRUPTS 58 - -#define METAL_MAX_CLIC_INTERRUPTS 3 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 32 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 32 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 32000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -static inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_MAX_CLIC_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 3; - } - else if (idx == 2) { - return 7; - } - else if (idx == 3) { - return 11; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 26; - } - else if (idx == 1) { - return 27; - } - else if (idx == 2) { - return 28; - } - else if (idx == 3) { - return 29; - } - else if (idx == 4) { - return 30; - } - else if (idx == 5) { - return 31; - } - else if (idx == 6) { - return 32; - } - else if (idx == 7) { - return 33; - } - else if (idx == 8) { - return 34; - } - else if (idx == 9) { - return 35; - } - else if (idx == 10) { - return 36; - } - else if (idx == 11) { - return 37; - } - else if (idx == 12) { - return 38; - } - else if (idx == 13) { - return 39; - } - else if (idx == 14) { - return 40; - } - else if (idx == 15) { - return 41; - } - else if (idx == 16) { - return 42; - } - else if (idx == 17) { - return 43; - } - else if (idx == 18) { - return 44; - } - else if (idx == 19) { - return 45; - } - else if (idx == 20) { - return 46; - } - else if (idx == 21) { - return 47; - } - else if (idx == 22) { - return 48; - } - else if (idx == 23) { - return 49; - } - else if (idx == 24) { - return 50; - } - else if (idx == 25) { - return 51; - } - else if (idx == 26) { - return 52; - } - else if (idx == 27) { - return 53; - } - else if (idx == 28) { - return 54; - } - else if (idx == 29) { - return 55; - } - else if (idx == 30) { - return 56; - } - else if (idx == 31) { - return 57; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 22; - } - else if (idx == 1) { - return 23; - } - else if (idx == 2) { - return 24; - } - else if (idx == 3) { - return 25; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 0; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 15; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 20; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 21; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 22; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 23; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 16; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 17; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 18; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 19; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 16; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 2 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_sys_sram_0_80000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@2000000 */ -#define __METAL_DT_SIFIVE_CLIC0_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_2000000_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E20_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e20-arty/metal.ramrodata.lds b/bsp/coreip-e20-arty/metal.ramrodata.lds deleted file mode 100644 index 0c6fffa..0000000 --- a/bsp/coreip-e20-arty/metal.ramrodata.lds +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e20-arty/metal.scratchpad.lds b/bsp/coreip-e20-arty/metal.scratchpad.lds deleted file mode 100644 index fc6d880..0000000 --- a/bsp/coreip-e20-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e20-arty/openocd.cfg b/bsp/coreip-e20-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-e20-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-e20-arty/settings.mk b/bsp/coreip-e20-arty/settings.mk deleted file mode 100644 index 597ca57..0000000 --- a/bsp/coreip-e20-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imc -RISCV_ABI=ilp32 -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-2-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-e20-rtl/README.md b/bsp/coreip-e20-rtl/README.md deleted file mode 100644 index f908327..0000000 --- a/bsp/coreip-e20-rtl/README.md +++ /dev/null @@ -1,6 +0,0 @@ -The SiFive E20 Standard Core is an extremely efficient implementation of the E2 Series configured for very low area and power. The E20 brings the power of the RISC-V software ecosystem to efficiently address traditional 8-bit and 32-bit microcontroller applications such as IoT, Analog Mixed Signal, and Programmable Finite State Machines. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMC core -- 4 hardware breakpoints diff --git a/bsp/coreip-e20-rtl/design.dts b/bsp/coreip-e20-rtl/design.dts deleted file mode 100644 index d57c342..0000000 --- a/bsp/coreip-e20-rtl/design.dts +++ /dev/null @@ -1,72 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE200G-dev", "fe200-dev", "sifive-dev"; - model = "SiFive,FE200G"; - L10: cpus { - #address-cells = <1>; - #size-cells = <0>; - L3: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,caboose0", "riscv"; - device_type = "cpu"; - reg = <0x0>; - riscv,isa = "rv32imc"; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L2: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L9: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE200G-soc", "fe200-soc", "sifive-soc", "simple-bus"; - ranges; - L7: ahb-sys-port@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-sys-port", "sifive,ahb-port", "sifive,sys-port", "simple-bus"; - ranges = <0x20000000 0x20000000 0x20000000>; - }; - L1: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L2 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: interrupt-controller@2000000 { - #interrupt-cells = <1>; - compatible = "sifive,clic0"; - interrupt-controller; - interrupts-extended = <&L2 3 &L2 7 &L2 11>; - reg = <0x2000000 0x1000000>; - reg-names = "control"; - sifive,numints = <48>; - sifive,numlevels = <16>; - sifive,numintbits = <2>; - }; - L6: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L0>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L4: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x20000000 0x8000000>; - reg-names = "mem"; - word-size-bytes = <4>; - }; - }; -}; diff --git a/bsp/coreip-e20-rtl/design.reglist b/bsp/coreip-e20-rtl/design.reglist deleted file mode 100644 index 645819d..0000000 --- a/bsp/coreip-e20-rtl/design.reglist +++ /dev/null @@ -1,214 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mscratch -mepc -mcause -mtval -mip -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e20-rtl/metal-inline.h b/bsp/coreip-e20-rtl/metal-inline.h deleted file mode 100644 index cb6d9bc..0000000 --- a/bsp/coreip-e20-rtl/metal-inline.h +++ /dev/null @@ -1,132 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E20_RTL__METAL_INLINE_H -#define COREIP_E20_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller); - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 134217728UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000 = { - .controller.vtable = &__metal_driver_vtable_sifive_clic0.clic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_E20_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e20-rtl/metal-platform.h b/bsp/coreip-e20-rtl/metal-platform.h deleted file mode 100644 index 014341a..0000000 --- a/bsp/coreip-e20-rtl/metal-platform.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E20_RTL__METAL_PLATFORM_H -#define COREIP_E20_RTL__METAL_PLATFORM_H - -/* From interrupt_controller@2000000 */ -#define METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_0_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_2000000_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_0_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS 48UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTS 48UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS 2UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTBITS 2UL - -#define METAL_SIFIVE_CLIC0 -#define METAL_SIFIVE_CLIC0_MSIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_MTIMECMP_BASE 16384UL -#define METAL_SIFIVE_CLIC0_MTIME 49144UL -#define METAL_SIFIVE_CLIC0_CLICINTIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_CLICINTIE_BASE 1024UL -#define METAL_SIFIVE_CLIC0_CLICINTCTL_BASE 2048UL -#define METAL_SIFIVE_CLIC0_CLICCFG 3072UL -#define METAL_SIFIVE_CLIC0_MMODE_APERTURE 8388608UL -#define METAL_SIFIVE_CLIC0_HSMODE_APERTURE 10485760UL -#define METAL_SIFIVE_CLIC0_SMODE_APERTURE 12582912UL -#define METAL_SIFIVE_CLIC0_UMODE_APERTURE 14680064UL - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_E20_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e20-rtl/metal.default.lds b/bsp/coreip-e20-rtl/metal.default.lds deleted file mode 100644 index 633a5bc..0000000 --- a/bsp/coreip-e20-rtl/metal.default.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e20-rtl/metal.h b/bsp/coreip-e20-rtl/metal.h deleted file mode 100644 index 85e9b4f..0000000 --- a/bsp/coreip-e20-rtl/metal.h +++ /dev/null @@ -1,467 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E20_RTL__METAL_H -#define MACROS_IF_COREIP_E20_RTL__METAL_H - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#define __METAL_CLIC_SUBINTERRUPTS 48 - -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E20_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E20_RTL__METAL_H -#define MACROS_ELSE_COREIP_E20_RTL__METAL_H - -#define METAL_MAX_CLINT_INTERRUPTS 0 - -#define __METAL_CLINT_NUM_PARENTS 0 - -#define __METAL_PLIC_SUBINTERRUPTS 0 -#define METAL_MAX_PLIC_INTERRUPTS 0 - -#define __METAL_PLIC_NUM_PARENTS 0 - -#define __METAL_INTERRUPT_CONTROLLER_2000000_INTERRUPTS 3 - -#define __METAL_CLIC_SUBINTERRUPTS 48 - -#define METAL_MAX_CLIC_INTERRUPTS 3 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 32 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 32 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 0 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_testram_20000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -static inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_MAX_CLIC_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 3; - } - else if (idx == 2) { - return 7; - } - else if (idx == 3) { - return 11; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 0; - } - else if (idx == 1) { - return 1; - } - else if (idx == 2) { - return 2; - } - else if (idx == 3) { - return 3; - } - else if (idx == 4) { - return 4; - } - else if (idx == 5) { - return 5; - } - else if (idx == 6) { - return 6; - } - else if (idx == 7) { - return 7; - } - else if (idx == 8) { - return 8; - } - else if (idx == 9) { - return 9; - } - else if (idx == 10) { - return 10; - } - else if (idx == 11) { - return 11; - } - else if (idx == 12) { - return 12; - } - else if (idx == 13) { - return 13; - } - else if (idx == 14) { - return 14; - } - else if (idx == 15) { - return 15; - } - else if (idx == 16) { - return 16; - } - else if (idx == 17) { - return 17; - } - else if (idx == 18) { - return 18; - } - else if (idx == 19) { - return 19; - } - else if (idx == 20) { - return 20; - } - else if (idx == 21) { - return 21; - } - else if (idx == 22) { - return 22; - } - else if (idx == 23) { - return 23; - } - else if (idx == 24) { - return 24; - } - else if (idx == 25) { - return 25; - } - else if (idx == 26) { - return 26; - } - else if (idx == 27) { - return 27; - } - else if (idx == 28) { - return 28; - } - else if (idx == 29) { - return 29; - } - else if (idx == 30) { - return 30; - } - else if (idx == 31) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 1 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_testram_20000000}; - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@2000000 */ -#define __METAL_DT_SIFIVE_CLIC0_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_2000000_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E20_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e20-rtl/metal.ramrodata.lds b/bsp/coreip-e20-rtl/metal.ramrodata.lds deleted file mode 100644 index 98acbca..0000000 --- a/bsp/coreip-e20-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - *(.itim .itim.*) - } >ram AT>ram :ram - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e20-rtl/metal.scratchpad.lds b/bsp/coreip-e20-rtl/metal.scratchpad.lds deleted file mode 100644 index 633a5bc..0000000 --- a/bsp/coreip-e20-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e20-rtl/settings.mk b/bsp/coreip-e20-rtl/settings.mk deleted file mode 100644 index 5b48994..0000000 --- a/bsp/coreip-e20-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imc -RISCV_ABI=ilp32 -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-2-series - -COREIP_MEM_WIDTH=32 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-e21-arty/README.md b/bsp/coreip-e21-arty/README.md deleted file mode 100644 index e0cb9a7..0000000 --- a/bsp/coreip-e21-arty/README.md +++ /dev/null @@ -1,14 +0,0 @@ -The SiFive E21 Standard Core is a high-performance, full-featured embedded processor designed to address advanced microcontroller applications such as Sensor Fusion, Smart IoT, Wearables, Connected Toys, and more. Separate Instruction and Data Buses, along with 2 banks of Tightly Integrated Memory (TIMs) make the E21 an ideal choice for applications with deterministic or demanding memory requirements. - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAC core -- 4 hardware breakpoints -- Physical Memory Protection with 4 regions -- Up to 153 CLIC interrupt signals that can be connected to off core complex devices, with 16 levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches - diff --git a/bsp/coreip-e21-arty/design.dts b/bsp/coreip-e21-arty/design.dts deleted file mode 100644 index 40f61d0..0000000 --- a/bsp/coreip-e21-arty/design.dts +++ /dev/null @@ -1,197 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE210G-dev", "fe210-dev", "sifive-dev"; - model = "SiFive,FE210G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L7 0x400000>; - }; - L17: aliases { - serial0 = &L6; - }; - L16: cpus { - #address-cells = <1>; - #size-cells = <0>; - L4: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,caboose0", "riscv"; - device_type = "cpu"; - reg = <0x0>; - riscv,isa = "rv32imac"; - riscv,pmpregions = <4>; - status = "okay"; - timebase-frequency = <32000000>; - hardware-exec-breakpoint-count = <4>; - L3: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L15: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE210G-soc", "fe210-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L2: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L3 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L12: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <22 23 24 25>; - }; - L5: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@2000000 { - #interrupt-cells = <1>; - compatible = "sifive,clic0"; - interrupt-controller; - interrupts-extended = <&L3 3 &L3 7 &L3 11>; - reg = <0x2000000 0x1000000>; - reg-names = "control"; - sifive,numints = <153>; - sifive,numlevels = <16>; - sifive,numintbits = <2>; - }; - L13: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152>; - }; - L8: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <18 19 20 21>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L6: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <16>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L7: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <17>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - L10: sys-sram-0@80000000 { - compatible = "sifive,sram0"; - reg = <0x80000000 0x8000>; - reg-names = "mem"; - }; - L11: sys-sram-1@80008000 { - compatible = "sifive,sram0"; - reg = <0x80008000 0x8000>; - reg-names = "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L5 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L5 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L5 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L5 4>; - interrupts-extended = <&L13 20>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L5 5>; - interrupts-extended = <&L13 21>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L5 6>; - interrupts-extended = <&L13 22>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L5 7>; - interrupts-extended = <&L13 23>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L13 16>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L13 17>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L13 18>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L13 19>; - linux,code = "none"; - }; - L9: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-e21-arty/design.reglist b/bsp/coreip-e21-arty/design.reglist deleted file mode 100644 index 27ab72e..0000000 --- a/bsp/coreip-e21-arty/design.reglist +++ /dev/null @@ -1,227 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e21-arty/metal-inline.h b/bsp/coreip-e21-arty/metal-inline.h deleted file mode 100644 index 3808e1c..0000000 --- a/bsp/coreip-e21-arty/metal-inline.h +++ /dev/null @@ -1,272 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E21_ARTY__METAL_INLINE_H -#define COREIP_E21_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller); - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000 = { - ._base_address = 2147483648UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000 = { - ._base_address = 2147516416UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000 = { - .controller.vtable = &__metal_driver_vtable_sifive_clic0.clic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_E21_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e21-arty/metal-platform.h b/bsp/coreip-e21-arty/metal-platform.h deleted file mode 100644 index 7b8b34e..0000000 --- a/bsp/coreip-e21-arty/metal-platform.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E21_ARTY__METAL_PLATFORM_H -#define COREIP_E21_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From interrupt_controller@2000000 */ -#define METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_0_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_2000000_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_0_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS 153UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTS 153UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS 2UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTBITS 2UL - -#define METAL_SIFIVE_CLIC0 -#define METAL_SIFIVE_CLIC0_MSIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_MTIMECMP_BASE 16384UL -#define METAL_SIFIVE_CLIC0_MTIME 49144UL -#define METAL_SIFIVE_CLIC0_CLICINTIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_CLICINTIE_BASE 1024UL -#define METAL_SIFIVE_CLIC0_CLICINTCTL_BASE 2048UL -#define METAL_SIFIVE_CLIC0_CLICCFG 3072UL -#define METAL_SIFIVE_CLIC0_MMODE_APERTURE 8388608UL -#define METAL_SIFIVE_CLIC0_HSMODE_APERTURE 10485760UL -#define METAL_SIFIVE_CLIC0_SMODE_APERTURE 12582912UL -#define METAL_SIFIVE_CLIC0_UMODE_APERTURE 14680064UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_E21_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e21-arty/metal.default.lds b/bsp/coreip-e21-arty/metal.default.lds deleted file mode 100644 index 25bebae..0000000 --- a/bsp/coreip-e21-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e21-arty/metal.h b/bsp/coreip-e21-arty/metal.h deleted file mode 100644 index 59f1a24..0000000 --- a/bsp/coreip-e21-arty/metal.h +++ /dev/null @@ -1,1312 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E21_ARTY__METAL_H -#define MACROS_IF_COREIP_E21_ARTY__METAL_H - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#define __METAL_CLIC_SUBINTERRUPTS 153 - -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E21_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E21_ARTY__METAL_H -#define MACROS_ELSE_COREIP_E21_ARTY__METAL_H - -#define METAL_MAX_CLINT_INTERRUPTS 0 - -#define __METAL_CLINT_NUM_PARENTS 0 - -#define __METAL_PLIC_SUBINTERRUPTS 0 -#define METAL_MAX_PLIC_INTERRUPTS 0 - -#define __METAL_PLIC_NUM_PARENTS 0 - -#define __METAL_INTERRUPT_CONTROLLER_2000000_INTERRUPTS 3 - -#define __METAL_CLIC_SUBINTERRUPTS 153 - -#define METAL_MAX_CLIC_INTERRUPTS 3 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 127 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 127 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -struct metal_pmp __metal_dt_pmp; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 32000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 4; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -static inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_MAX_CLIC_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 3; - } - else if (idx == 2) { - return 7; - } - else if (idx == 3) { - return 11; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 26; - } - else if (idx == 1) { - return 27; - } - else if (idx == 2) { - return 28; - } - else if (idx == 3) { - return 29; - } - else if (idx == 4) { - return 30; - } - else if (idx == 5) { - return 31; - } - else if (idx == 6) { - return 32; - } - else if (idx == 7) { - return 33; - } - else if (idx == 8) { - return 34; - } - else if (idx == 9) { - return 35; - } - else if (idx == 10) { - return 36; - } - else if (idx == 11) { - return 37; - } - else if (idx == 12) { - return 38; - } - else if (idx == 13) { - return 39; - } - else if (idx == 14) { - return 40; - } - else if (idx == 15) { - return 41; - } - else if (idx == 16) { - return 42; - } - else if (idx == 17) { - return 43; - } - else if (idx == 18) { - return 44; - } - else if (idx == 19) { - return 45; - } - else if (idx == 20) { - return 46; - } - else if (idx == 21) { - return 47; - } - else if (idx == 22) { - return 48; - } - else if (idx == 23) { - return 49; - } - else if (idx == 24) { - return 50; - } - else if (idx == 25) { - return 51; - } - else if (idx == 26) { - return 52; - } - else if (idx == 27) { - return 53; - } - else if (idx == 28) { - return 54; - } - else if (idx == 29) { - return 55; - } - else if (idx == 30) { - return 56; - } - else if (idx == 31) { - return 57; - } - else if (idx == 32) { - return 58; - } - else if (idx == 33) { - return 59; - } - else if (idx == 34) { - return 60; - } - else if (idx == 35) { - return 61; - } - else if (idx == 36) { - return 62; - } - else if (idx == 37) { - return 63; - } - else if (idx == 38) { - return 64; - } - else if (idx == 39) { - return 65; - } - else if (idx == 40) { - return 66; - } - else if (idx == 41) { - return 67; - } - else if (idx == 42) { - return 68; - } - else if (idx == 43) { - return 69; - } - else if (idx == 44) { - return 70; - } - else if (idx == 45) { - return 71; - } - else if (idx == 46) { - return 72; - } - else if (idx == 47) { - return 73; - } - else if (idx == 48) { - return 74; - } - else if (idx == 49) { - return 75; - } - else if (idx == 50) { - return 76; - } - else if (idx == 51) { - return 77; - } - else if (idx == 52) { - return 78; - } - else if (idx == 53) { - return 79; - } - else if (idx == 54) { - return 80; - } - else if (idx == 55) { - return 81; - } - else if (idx == 56) { - return 82; - } - else if (idx == 57) { - return 83; - } - else if (idx == 58) { - return 84; - } - else if (idx == 59) { - return 85; - } - else if (idx == 60) { - return 86; - } - else if (idx == 61) { - return 87; - } - else if (idx == 62) { - return 88; - } - else if (idx == 63) { - return 89; - } - else if (idx == 64) { - return 90; - } - else if (idx == 65) { - return 91; - } - else if (idx == 66) { - return 92; - } - else if (idx == 67) { - return 93; - } - else if (idx == 68) { - return 94; - } - else if (idx == 69) { - return 95; - } - else if (idx == 70) { - return 96; - } - else if (idx == 71) { - return 97; - } - else if (idx == 72) { - return 98; - } - else if (idx == 73) { - return 99; - } - else if (idx == 74) { - return 100; - } - else if (idx == 75) { - return 101; - } - else if (idx == 76) { - return 102; - } - else if (idx == 77) { - return 103; - } - else if (idx == 78) { - return 104; - } - else if (idx == 79) { - return 105; - } - else if (idx == 80) { - return 106; - } - else if (idx == 81) { - return 107; - } - else if (idx == 82) { - return 108; - } - else if (idx == 83) { - return 109; - } - else if (idx == 84) { - return 110; - } - else if (idx == 85) { - return 111; - } - else if (idx == 86) { - return 112; - } - else if (idx == 87) { - return 113; - } - else if (idx == 88) { - return 114; - } - else if (idx == 89) { - return 115; - } - else if (idx == 90) { - return 116; - } - else if (idx == 91) { - return 117; - } - else if (idx == 92) { - return 118; - } - else if (idx == 93) { - return 119; - } - else if (idx == 94) { - return 120; - } - else if (idx == 95) { - return 121; - } - else if (idx == 96) { - return 122; - } - else if (idx == 97) { - return 123; - } - else if (idx == 98) { - return 124; - } - else if (idx == 99) { - return 125; - } - else if (idx == 100) { - return 126; - } - else if (idx == 101) { - return 127; - } - else if (idx == 102) { - return 128; - } - else if (idx == 103) { - return 129; - } - else if (idx == 104) { - return 130; - } - else if (idx == 105) { - return 131; - } - else if (idx == 106) { - return 132; - } - else if (idx == 107) { - return 133; - } - else if (idx == 108) { - return 134; - } - else if (idx == 109) { - return 135; - } - else if (idx == 110) { - return 136; - } - else if (idx == 111) { - return 137; - } - else if (idx == 112) { - return 138; - } - else if (idx == 113) { - return 139; - } - else if (idx == 114) { - return 140; - } - else if (idx == 115) { - return 141; - } - else if (idx == 116) { - return 142; - } - else if (idx == 117) { - return 143; - } - else if (idx == 118) { - return 144; - } - else if (idx == 119) { - return 145; - } - else if (idx == 120) { - return 146; - } - else if (idx == 121) { - return 147; - } - else if (idx == 122) { - return 148; - } - else if (idx == 123) { - return 149; - } - else if (idx == 124) { - return 150; - } - else if (idx == 125) { - return 151; - } - else if (idx == 126) { - return 152; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 22; - } - else if (idx == 1) { - return 23; - } - else if (idx == 2) { - return 24; - } - else if (idx == 3) { - return 25; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 0; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 15; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 20; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 21; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 22; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 23; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 16; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 17; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 18; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 19; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 16; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_sys_sram_0_80000000, - &__metal_dt_mem_sys_sram_1_80008000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From interrupt_controller@2000000 */ -#define __METAL_DT_SIFIVE_CLIC0_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_2000000_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E21_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e21-arty/metal.ramrodata.lds b/bsp/coreip-e21-arty/metal.ramrodata.lds deleted file mode 100644 index 4038c00..0000000 --- a/bsp/coreip-e21-arty/metal.ramrodata.lds +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e21-arty/metal.scratchpad.lds b/bsp/coreip-e21-arty/metal.scratchpad.lds deleted file mode 100644 index 2491581..0000000 --- a/bsp/coreip-e21-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e21-arty/openocd.cfg b/bsp/coreip-e21-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-e21-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-e21-arty/settings.mk b/bsp/coreip-e21-arty/settings.mk deleted file mode 100644 index 6723415..0000000 --- a/bsp/coreip-e21-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imac -RISCV_ABI=ilp32 -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-2-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-e21-rtl/README.md b/bsp/coreip-e21-rtl/README.md deleted file mode 100644 index 6b74a44..0000000 --- a/bsp/coreip-e21-rtl/README.md +++ /dev/null @@ -1,7 +0,0 @@ -The SiFive E21 Standard Core is a high-performance, full-featured embedded processor designed to address advanced microcontroller applications such as Sensor Fusion, Smart IoT, Wearables, Connected Toys, and more. Separate Instruction and Data Buses, along with 2 banks of Tightly Integrated Memory (TIMs) make the E21 an ideal choice for applications with deterministic or demanding memory requirements. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAC core -- 4 hardware breakpoints -- Physical Memory Protection with 4 regions diff --git a/bsp/coreip-e21-rtl/design.dts b/bsp/coreip-e21-rtl/design.dts deleted file mode 100644 index ed9fa86..0000000 --- a/bsp/coreip-e21-rtl/design.dts +++ /dev/null @@ -1,93 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE210G-dev", "fe210-dev", "sifive-dev"; - model = "SiFive,FE210G"; - L14: cpus { - #address-cells = <1>; - #size-cells = <0>; - L4: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,caboose0", "riscv"; - device_type = "cpu"; - reg = <0x0>; - riscv,isa = "rv32imac"; - riscv,pmpregions = <4>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L3: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L13: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE210G-soc", "fe210-soc", "sifive-soc", "simple-bus"; - ranges; - L11: ahb-periph-port@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-periph-port", "sifive,ahb-port", "sifive,periph-port", "simple-bus"; - ranges = <0x20000000 0x20000000 0x20000000>; - }; - L10: ahb-sys-port@40000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-sys-port", "sifive,ahb-port", "sifive,sys-port", "simple-bus"; - ranges = <0x40000000 0x40000000 0x20000000>; - }; - L2: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L3 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L1: interrupt-controller@2000000 { - #interrupt-cells = <1>; - compatible = "sifive,clic0"; - interrupt-controller; - interrupts-extended = <&L3 3 &L3 7 &L3 11>; - reg = <0x2000000 0x1000000>; - reg-names = "control"; - sifive,numints = <143>; - sifive,numlevels = <16>; - sifive,numintbits = <2>; - }; - L9: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126>; - }; - L6: sys-sram-0@80000000 { - compatible = "sifive,sram0"; - reg = <0x80000000 0x8000>; - reg-names = "mem"; - }; - L7: sys-sram-1@80008000 { - compatible = "sifive,sram0"; - reg = <0x80008000 0x8000>; - reg-names = "mem"; - }; - L5: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x20000000 0x8000000>; - reg-names = "mem"; - word-size-bytes = <4>; - }; - }; -}; diff --git a/bsp/coreip-e21-rtl/design.reglist b/bsp/coreip-e21-rtl/design.reglist deleted file mode 100644 index 27ab72e..0000000 --- a/bsp/coreip-e21-rtl/design.reglist +++ /dev/null @@ -1,227 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e21-rtl/metal-inline.h b/bsp/coreip-e21-rtl/metal-inline.h deleted file mode 100644 index 554db54..0000000 --- a/bsp/coreip-e21-rtl/metal-inline.h +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E21_RTL__METAL_INLINE_H -#define COREIP_E21_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller); - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000 = { - ._base_address = 2147483648UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000 = { - ._base_address = 2147516416UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 134217728UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000 = { - .controller.vtable = &__metal_driver_vtable_sifive_clic0.clic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_E21_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e21-rtl/metal-platform.h b/bsp/coreip-e21-rtl/metal-platform.h deleted file mode 100644 index 3cfaf5d..0000000 --- a/bsp/coreip-e21-rtl/metal-platform.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E21_RTL__METAL_PLATFORM_H -#define COREIP_E21_RTL__METAL_PLATFORM_H - -/* From interrupt_controller@2000000 */ -#define METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_0_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_2000000_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_0_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS 143UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTS 143UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS 2UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTBITS 2UL - -#define METAL_SIFIVE_CLIC0 -#define METAL_SIFIVE_CLIC0_MSIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_MTIMECMP_BASE 16384UL -#define METAL_SIFIVE_CLIC0_MTIME 49144UL -#define METAL_SIFIVE_CLIC0_CLICINTIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_CLICINTIE_BASE 1024UL -#define METAL_SIFIVE_CLIC0_CLICINTCTL_BASE 2048UL -#define METAL_SIFIVE_CLIC0_CLICCFG 3072UL -#define METAL_SIFIVE_CLIC0_MMODE_APERTURE 8388608UL -#define METAL_SIFIVE_CLIC0_HSMODE_APERTURE 10485760UL -#define METAL_SIFIVE_CLIC0_SMODE_APERTURE 12582912UL -#define METAL_SIFIVE_CLIC0_UMODE_APERTURE 14680064UL - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_E21_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e21-rtl/metal.default.lds b/bsp/coreip-e21-rtl/metal.default.lds deleted file mode 100644 index e3965ae..0000000 --- a/bsp/coreip-e21-rtl/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e21-rtl/metal.h b/bsp/coreip-e21-rtl/metal.h deleted file mode 100644 index b20f279..0000000 --- a/bsp/coreip-e21-rtl/metal.h +++ /dev/null @@ -1,762 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E21_RTL__METAL_H -#define MACROS_IF_COREIP_E21_RTL__METAL_H - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#define __METAL_CLIC_SUBINTERRUPTS 143 - -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E21_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E21_RTL__METAL_H -#define MACROS_ELSE_COREIP_E21_RTL__METAL_H - -#define METAL_MAX_CLINT_INTERRUPTS 0 - -#define __METAL_CLINT_NUM_PARENTS 0 - -#define __METAL_PLIC_SUBINTERRUPTS 0 -#define METAL_MAX_PLIC_INTERRUPTS 0 - -#define __METAL_PLIC_NUM_PARENTS 0 - -#define __METAL_INTERRUPT_CONTROLLER_2000000_INTERRUPTS 3 - -#define __METAL_CLIC_SUBINTERRUPTS 143 - -#define METAL_MAX_CLIC_INTERRUPTS 3 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 127 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 0 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000; - -struct metal_memory __metal_dt_mem_testram_20000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -struct metal_pmp __metal_dt_pmp; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 4; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -static inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_MAX_CLIC_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 3; - } - else if (idx == 2) { - return 7; - } - else if (idx == 3) { - return 11; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 0; - } - else if (idx == 1) { - return 1; - } - else if (idx == 2) { - return 2; - } - else if (idx == 3) { - return 3; - } - else if (idx == 4) { - return 4; - } - else if (idx == 5) { - return 5; - } - else if (idx == 6) { - return 6; - } - else if (idx == 7) { - return 7; - } - else if (idx == 8) { - return 8; - } - else if (idx == 9) { - return 9; - } - else if (idx == 10) { - return 10; - } - else if (idx == 11) { - return 11; - } - else if (idx == 12) { - return 12; - } - else if (idx == 13) { - return 13; - } - else if (idx == 14) { - return 14; - } - else if (idx == 15) { - return 15; - } - else if (idx == 16) { - return 16; - } - else if (idx == 17) { - return 17; - } - else if (idx == 18) { - return 18; - } - else if (idx == 19) { - return 19; - } - else if (idx == 20) { - return 20; - } - else if (idx == 21) { - return 21; - } - else if (idx == 22) { - return 22; - } - else if (idx == 23) { - return 23; - } - else if (idx == 24) { - return 24; - } - else if (idx == 25) { - return 25; - } - else if (idx == 26) { - return 26; - } - else if (idx == 27) { - return 27; - } - else if (idx == 28) { - return 28; - } - else if (idx == 29) { - return 29; - } - else if (idx == 30) { - return 30; - } - else if (idx == 31) { - return 31; - } - else if (idx == 32) { - return 32; - } - else if (idx == 33) { - return 33; - } - else if (idx == 34) { - return 34; - } - else if (idx == 35) { - return 35; - } - else if (idx == 36) { - return 36; - } - else if (idx == 37) { - return 37; - } - else if (idx == 38) { - return 38; - } - else if (idx == 39) { - return 39; - } - else if (idx == 40) { - return 40; - } - else if (idx == 41) { - return 41; - } - else if (idx == 42) { - return 42; - } - else if (idx == 43) { - return 43; - } - else if (idx == 44) { - return 44; - } - else if (idx == 45) { - return 45; - } - else if (idx == 46) { - return 46; - } - else if (idx == 47) { - return 47; - } - else if (idx == 48) { - return 48; - } - else if (idx == 49) { - return 49; - } - else if (idx == 50) { - return 50; - } - else if (idx == 51) { - return 51; - } - else if (idx == 52) { - return 52; - } - else if (idx == 53) { - return 53; - } - else if (idx == 54) { - return 54; - } - else if (idx == 55) { - return 55; - } - else if (idx == 56) { - return 56; - } - else if (idx == 57) { - return 57; - } - else if (idx == 58) { - return 58; - } - else if (idx == 59) { - return 59; - } - else if (idx == 60) { - return 60; - } - else if (idx == 61) { - return 61; - } - else if (idx == 62) { - return 62; - } - else if (idx == 63) { - return 63; - } - else if (idx == 64) { - return 64; - } - else if (idx == 65) { - return 65; - } - else if (idx == 66) { - return 66; - } - else if (idx == 67) { - return 67; - } - else if (idx == 68) { - return 68; - } - else if (idx == 69) { - return 69; - } - else if (idx == 70) { - return 70; - } - else if (idx == 71) { - return 71; - } - else if (idx == 72) { - return 72; - } - else if (idx == 73) { - return 73; - } - else if (idx == 74) { - return 74; - } - else if (idx == 75) { - return 75; - } - else if (idx == 76) { - return 76; - } - else if (idx == 77) { - return 77; - } - else if (idx == 78) { - return 78; - } - else if (idx == 79) { - return 79; - } - else if (idx == 80) { - return 80; - } - else if (idx == 81) { - return 81; - } - else if (idx == 82) { - return 82; - } - else if (idx == 83) { - return 83; - } - else if (idx == 84) { - return 84; - } - else if (idx == 85) { - return 85; - } - else if (idx == 86) { - return 86; - } - else if (idx == 87) { - return 87; - } - else if (idx == 88) { - return 88; - } - else if (idx == 89) { - return 89; - } - else if (idx == 90) { - return 90; - } - else if (idx == 91) { - return 91; - } - else if (idx == 92) { - return 92; - } - else if (idx == 93) { - return 93; - } - else if (idx == 94) { - return 94; - } - else if (idx == 95) { - return 95; - } - else if (idx == 96) { - return 96; - } - else if (idx == 97) { - return 97; - } - else if (idx == 98) { - return 98; - } - else if (idx == 99) { - return 99; - } - else if (idx == 100) { - return 100; - } - else if (idx == 101) { - return 101; - } - else if (idx == 102) { - return 102; - } - else if (idx == 103) { - return 103; - } - else if (idx == 104) { - return 104; - } - else if (idx == 105) { - return 105; - } - else if (idx == 106) { - return 106; - } - else if (idx == 107) { - return 107; - } - else if (idx == 108) { - return 108; - } - else if (idx == 109) { - return 109; - } - else if (idx == 110) { - return 110; - } - else if (idx == 111) { - return 111; - } - else if (idx == 112) { - return 112; - } - else if (idx == 113) { - return 113; - } - else if (idx == 114) { - return 114; - } - else if (idx == 115) { - return 115; - } - else if (idx == 116) { - return 116; - } - else if (idx == 117) { - return 117; - } - else if (idx == 118) { - return 118; - } - else if (idx == 119) { - return 119; - } - else if (idx == 120) { - return 120; - } - else if (idx == 121) { - return 121; - } - else if (idx == 122) { - return 122; - } - else if (idx == 123) { - return 123; - } - else if (idx == 124) { - return 124; - } - else if (idx == 125) { - return 125; - } - else if (idx == 126) { - return 126; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_sys_sram_0_80000000, - &__metal_dt_mem_sys_sram_1_80008000, - &__metal_dt_mem_testram_20000000}; - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From interrupt_controller@2000000 */ -#define __METAL_DT_SIFIVE_CLIC0_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_2000000_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E21_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e21-rtl/metal.ramrodata.lds b/bsp/coreip-e21-rtl/metal.ramrodata.lds deleted file mode 100644 index 4dde16c..0000000 --- a/bsp/coreip-e21-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e21-rtl/metal.scratchpad.lds b/bsp/coreip-e21-rtl/metal.scratchpad.lds deleted file mode 100644 index b4236fd..0000000 --- a/bsp/coreip-e21-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e21-rtl/settings.mk b/bsp/coreip-e21-rtl/settings.mk deleted file mode 100644 index af81896..0000000 --- a/bsp/coreip-e21-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imac -RISCV_ABI=ilp32 -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-2-series - -COREIP_MEM_WIDTH=32 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-e24-arty/README.md b/bsp/coreip-e24-arty/README.md deleted file mode 100644 index 79dfae8..0000000 --- a/bsp/coreip-e24-arty/README.md +++ /dev/null @@ -1,13 +0,0 @@ -The SiFive E24 Standard Core is a high-performance microcontroller with hardware support for single-precision floating-point capabilities by implementing the RISC-V ISA’s F standard extension. The E24’s efficiency, coupled with hardware floating-point capabilities, make it exceptional at motor control, sensor fusion, and IoT applications. - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAFC core -- 4 hardware breakpoints -- Physical Memory Protection with 4 regions -- Up to 153 CLIC interrupt signals that can be connected to off core complex devices, with 16 levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-e24-arty/design.dts b/bsp/coreip-e24-arty/design.dts deleted file mode 100644 index ba6b037..0000000 --- a/bsp/coreip-e24-arty/design.dts +++ /dev/null @@ -1,197 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE240G-dev", "fe240-dev", "sifive-dev"; - model = "SiFive,FE240G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L7 0x400000>; - }; - L17: aliases { - serial0 = &L6; - }; - L16: cpus { - #address-cells = <1>; - #size-cells = <0>; - L4: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,caboose0", "riscv"; - device_type = "cpu"; - reg = <0x0>; - riscv,isa = "rv32imafc"; - riscv,pmpregions = <4>; - status = "okay"; - timebase-frequency = <32000000>; - hardware-exec-breakpoint-count = <4>; - L3: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L15: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE240G-soc", "fe240-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L2: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L3 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L12: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <22 23 24 25>; - }; - L5: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@2000000 { - #interrupt-cells = <1>; - compatible = "sifive,clic0"; - interrupt-controller; - interrupts-extended = <&L3 3 &L3 7 &L3 11>; - reg = <0x2000000 0x1000000>; - reg-names = "control"; - sifive,numints = <153>; - sifive,numlevels = <16>; - sifive,numintbits = <4>; - }; - L13: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152>; - }; - L8: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <18 19 20 21>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L6: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <16>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L7: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <17>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - L10: sys-sram-0@80000000 { - compatible = "sifive,sram0"; - reg = <0x80000000 0x8000>; - reg-names = "mem"; - }; - L11: sys-sram-1@80008000 { - compatible = "sifive,sram0"; - reg = <0x80008000 0x8000>; - reg-names = "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L5 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L5 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L5 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L5 4>; - interrupts-extended = <&L13 20>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L5 5>; - interrupts-extended = <&L13 21>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L5 6>; - interrupts-extended = <&L13 22>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L5 7>; - interrupts-extended = <&L13 23>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L13 16>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L13 17>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L13 18>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L13 19>; - linux,code = "none"; - }; - L9: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-e24-arty/design.reglist b/bsp/coreip-e24-arty/design.reglist deleted file mode 100644 index 386db06..0000000 --- a/bsp/coreip-e24-arty/design.reglist +++ /dev/null @@ -1,262 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e24-arty/metal-inline.h b/bsp/coreip-e24-arty/metal-inline.h deleted file mode 100644 index 91677fd..0000000 --- a/bsp/coreip-e24-arty/metal-inline.h +++ /dev/null @@ -1,272 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E24_ARTY__METAL_INLINE_H -#define COREIP_E24_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller); - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000 = { - ._base_address = 2147483648UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000 = { - ._base_address = 2147516416UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000 = { - .controller.vtable = &__metal_driver_vtable_sifive_clic0.clic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_E24_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e24-arty/metal-platform.h b/bsp/coreip-e24-arty/metal-platform.h deleted file mode 100644 index d28945a..0000000 --- a/bsp/coreip-e24-arty/metal-platform.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E24_ARTY__METAL_PLATFORM_H -#define COREIP_E24_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From interrupt_controller@2000000 */ -#define METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_0_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_2000000_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_0_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS 153UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTS 153UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS 4UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTBITS 4UL - -#define METAL_SIFIVE_CLIC0 -#define METAL_SIFIVE_CLIC0_MSIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_MTIMECMP_BASE 16384UL -#define METAL_SIFIVE_CLIC0_MTIME 49144UL -#define METAL_SIFIVE_CLIC0_CLICINTIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_CLICINTIE_BASE 1024UL -#define METAL_SIFIVE_CLIC0_CLICINTCTL_BASE 2048UL -#define METAL_SIFIVE_CLIC0_CLICCFG 3072UL -#define METAL_SIFIVE_CLIC0_MMODE_APERTURE 8388608UL -#define METAL_SIFIVE_CLIC0_HSMODE_APERTURE 10485760UL -#define METAL_SIFIVE_CLIC0_SMODE_APERTURE 12582912UL -#define METAL_SIFIVE_CLIC0_UMODE_APERTURE 14680064UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_E24_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e24-arty/metal.default.lds b/bsp/coreip-e24-arty/metal.default.lds deleted file mode 100644 index 25bebae..0000000 --- a/bsp/coreip-e24-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e24-arty/metal.h b/bsp/coreip-e24-arty/metal.h deleted file mode 100644 index f50084c..0000000 --- a/bsp/coreip-e24-arty/metal.h +++ /dev/null @@ -1,1312 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E24_ARTY__METAL_H -#define MACROS_IF_COREIP_E24_ARTY__METAL_H - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#define __METAL_CLIC_SUBINTERRUPTS 153 - -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E24_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E24_ARTY__METAL_H -#define MACROS_ELSE_COREIP_E24_ARTY__METAL_H - -#define METAL_MAX_CLINT_INTERRUPTS 0 - -#define __METAL_CLINT_NUM_PARENTS 0 - -#define __METAL_PLIC_SUBINTERRUPTS 0 -#define METAL_MAX_PLIC_INTERRUPTS 0 - -#define __METAL_PLIC_NUM_PARENTS 0 - -#define __METAL_INTERRUPT_CONTROLLER_2000000_INTERRUPTS 3 - -#define __METAL_CLIC_SUBINTERRUPTS 153 - -#define METAL_MAX_CLIC_INTERRUPTS 3 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 127 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 127 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -struct metal_pmp __metal_dt_pmp; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 32000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 4; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -static inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_MAX_CLIC_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 3; - } - else if (idx == 2) { - return 7; - } - else if (idx == 3) { - return 11; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 26; - } - else if (idx == 1) { - return 27; - } - else if (idx == 2) { - return 28; - } - else if (idx == 3) { - return 29; - } - else if (idx == 4) { - return 30; - } - else if (idx == 5) { - return 31; - } - else if (idx == 6) { - return 32; - } - else if (idx == 7) { - return 33; - } - else if (idx == 8) { - return 34; - } - else if (idx == 9) { - return 35; - } - else if (idx == 10) { - return 36; - } - else if (idx == 11) { - return 37; - } - else if (idx == 12) { - return 38; - } - else if (idx == 13) { - return 39; - } - else if (idx == 14) { - return 40; - } - else if (idx == 15) { - return 41; - } - else if (idx == 16) { - return 42; - } - else if (idx == 17) { - return 43; - } - else if (idx == 18) { - return 44; - } - else if (idx == 19) { - return 45; - } - else if (idx == 20) { - return 46; - } - else if (idx == 21) { - return 47; - } - else if (idx == 22) { - return 48; - } - else if (idx == 23) { - return 49; - } - else if (idx == 24) { - return 50; - } - else if (idx == 25) { - return 51; - } - else if (idx == 26) { - return 52; - } - else if (idx == 27) { - return 53; - } - else if (idx == 28) { - return 54; - } - else if (idx == 29) { - return 55; - } - else if (idx == 30) { - return 56; - } - else if (idx == 31) { - return 57; - } - else if (idx == 32) { - return 58; - } - else if (idx == 33) { - return 59; - } - else if (idx == 34) { - return 60; - } - else if (idx == 35) { - return 61; - } - else if (idx == 36) { - return 62; - } - else if (idx == 37) { - return 63; - } - else if (idx == 38) { - return 64; - } - else if (idx == 39) { - return 65; - } - else if (idx == 40) { - return 66; - } - else if (idx == 41) { - return 67; - } - else if (idx == 42) { - return 68; - } - else if (idx == 43) { - return 69; - } - else if (idx == 44) { - return 70; - } - else if (idx == 45) { - return 71; - } - else if (idx == 46) { - return 72; - } - else if (idx == 47) { - return 73; - } - else if (idx == 48) { - return 74; - } - else if (idx == 49) { - return 75; - } - else if (idx == 50) { - return 76; - } - else if (idx == 51) { - return 77; - } - else if (idx == 52) { - return 78; - } - else if (idx == 53) { - return 79; - } - else if (idx == 54) { - return 80; - } - else if (idx == 55) { - return 81; - } - else if (idx == 56) { - return 82; - } - else if (idx == 57) { - return 83; - } - else if (idx == 58) { - return 84; - } - else if (idx == 59) { - return 85; - } - else if (idx == 60) { - return 86; - } - else if (idx == 61) { - return 87; - } - else if (idx == 62) { - return 88; - } - else if (idx == 63) { - return 89; - } - else if (idx == 64) { - return 90; - } - else if (idx == 65) { - return 91; - } - else if (idx == 66) { - return 92; - } - else if (idx == 67) { - return 93; - } - else if (idx == 68) { - return 94; - } - else if (idx == 69) { - return 95; - } - else if (idx == 70) { - return 96; - } - else if (idx == 71) { - return 97; - } - else if (idx == 72) { - return 98; - } - else if (idx == 73) { - return 99; - } - else if (idx == 74) { - return 100; - } - else if (idx == 75) { - return 101; - } - else if (idx == 76) { - return 102; - } - else if (idx == 77) { - return 103; - } - else if (idx == 78) { - return 104; - } - else if (idx == 79) { - return 105; - } - else if (idx == 80) { - return 106; - } - else if (idx == 81) { - return 107; - } - else if (idx == 82) { - return 108; - } - else if (idx == 83) { - return 109; - } - else if (idx == 84) { - return 110; - } - else if (idx == 85) { - return 111; - } - else if (idx == 86) { - return 112; - } - else if (idx == 87) { - return 113; - } - else if (idx == 88) { - return 114; - } - else if (idx == 89) { - return 115; - } - else if (idx == 90) { - return 116; - } - else if (idx == 91) { - return 117; - } - else if (idx == 92) { - return 118; - } - else if (idx == 93) { - return 119; - } - else if (idx == 94) { - return 120; - } - else if (idx == 95) { - return 121; - } - else if (idx == 96) { - return 122; - } - else if (idx == 97) { - return 123; - } - else if (idx == 98) { - return 124; - } - else if (idx == 99) { - return 125; - } - else if (idx == 100) { - return 126; - } - else if (idx == 101) { - return 127; - } - else if (idx == 102) { - return 128; - } - else if (idx == 103) { - return 129; - } - else if (idx == 104) { - return 130; - } - else if (idx == 105) { - return 131; - } - else if (idx == 106) { - return 132; - } - else if (idx == 107) { - return 133; - } - else if (idx == 108) { - return 134; - } - else if (idx == 109) { - return 135; - } - else if (idx == 110) { - return 136; - } - else if (idx == 111) { - return 137; - } - else if (idx == 112) { - return 138; - } - else if (idx == 113) { - return 139; - } - else if (idx == 114) { - return 140; - } - else if (idx == 115) { - return 141; - } - else if (idx == 116) { - return 142; - } - else if (idx == 117) { - return 143; - } - else if (idx == 118) { - return 144; - } - else if (idx == 119) { - return 145; - } - else if (idx == 120) { - return 146; - } - else if (idx == 121) { - return 147; - } - else if (idx == 122) { - return 148; - } - else if (idx == 123) { - return 149; - } - else if (idx == 124) { - return 150; - } - else if (idx == 125) { - return 151; - } - else if (idx == 126) { - return 152; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 22; - } - else if (idx == 1) { - return 23; - } - else if (idx == 2) { - return 24; - } - else if (idx == 3) { - return 25; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 0; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 15; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 20; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 21; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 22; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 23; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 16; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 17; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 18; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 19; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 16; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_sys_sram_0_80000000, - &__metal_dt_mem_sys_sram_1_80008000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From interrupt_controller@2000000 */ -#define __METAL_DT_SIFIVE_CLIC0_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_2000000_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E24_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e24-arty/metal.ramrodata.lds b/bsp/coreip-e24-arty/metal.ramrodata.lds deleted file mode 100644 index 4038c00..0000000 --- a/bsp/coreip-e24-arty/metal.ramrodata.lds +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e24-arty/metal.scratchpad.lds b/bsp/coreip-e24-arty/metal.scratchpad.lds deleted file mode 100644 index 2491581..0000000 --- a/bsp/coreip-e24-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e24-arty/openocd.cfg b/bsp/coreip-e24-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-e24-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-e24-arty/settings.mk b/bsp/coreip-e24-arty/settings.mk deleted file mode 100644 index e701d94..0000000 --- a/bsp/coreip-e24-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imafc -RISCV_ABI=ilp32f -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-2-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-e24-rtl/README.md b/bsp/coreip-e24-rtl/README.md deleted file mode 100644 index 1996262..0000000 --- a/bsp/coreip-e24-rtl/README.md +++ /dev/null @@ -1,8 +0,0 @@ -The SiFive E24 Standard Core is a high-performance microcontroller with hardware support for single-precision floating-point capabilities by implementing the RISC-V ISA’s F standard extension. The E24’s efficiency, coupled with hardware floating-point capabilities, make it exceptional at motor control, sensor fusion, and IoT applications. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAFC core -- 4 hardware breakpoints -- Physical Memory Protection with 4 regions - diff --git a/bsp/coreip-e24-rtl/design.dts b/bsp/coreip-e24-rtl/design.dts deleted file mode 100644 index a254a10..0000000 --- a/bsp/coreip-e24-rtl/design.dts +++ /dev/null @@ -1,94 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE240G-dev", "fe240-dev", "sifive-dev"; - model = "SiFive,FE240G"; - L14: cpus { - #address-cells = <1>; - #size-cells = <0>; - L4: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,caboose0", "riscv"; - device_type = "cpu"; - reg = <0x0>; - riscv,isa = "rv32imafc"; - riscv,pmpregions = <4>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L3: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L13: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE240G-soc", "fe240-soc", "sifive-soc", "simple-bus"; - ranges; - L11: ahb-periph-port@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-periph-port", "sifive,ahb-port", "sifive,periph-port", "simple-bus"; - ranges = <0x20000000 0x20000000 0x20000000>; - }; - L10: ahb-sys-port@40000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-sys-port", "sifive,ahb-port", "sifive,sys-port", "simple-bus"; - ranges = <0x40000000 0x40000000 0x20000000>; - }; - L2: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L3 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - reg-names = "mem"; - }; - L1: interrupt-controller@2000000 { - #interrupt-cells = <1>; - compatible = "sifive,clic0"; - interrupt-controller; - interrupts-extended = <&L3 3 &L3 7 &L3 11>; - reg = <0x2000000 0x1000000>; - reg-names = "control"; - sifive,numints = <143>; - sifive,numlevels = <16>; - sifive,numintbits = <4>; - }; - L9: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126>; - }; - L6: sys-sram-0@80000000 { - compatible = "sifive,sram0"; - reg = <0x80000000 0x8000>; - reg-names = "mem"; - }; - L7: sys-sram-1@80008000 { - compatible = "sifive,sram0"; - reg = <0x80008000 0x8000>; - reg-names = "mem"; - }; - L5: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x20000000 0x8000000>; - reg-names = "mem"; - word-size-bytes = <4>; - }; - }; -}; diff --git a/bsp/coreip-e24-rtl/design.reglist b/bsp/coreip-e24-rtl/design.reglist deleted file mode 100644 index 386db06..0000000 --- a/bsp/coreip-e24-rtl/design.reglist +++ /dev/null @@ -1,262 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e24-rtl/metal-inline.h b/bsp/coreip-e24-rtl/metal-inline.h deleted file mode 100644 index a61924e..0000000 --- a/bsp/coreip-e24-rtl/metal-inline.h +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E24_RTL__METAL_INLINE_H -#define COREIP_E24_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller); - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000 = { - ._base_address = 2147483648UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000 = { - ._base_address = 2147516416UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 134217728UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000 = { - .controller.vtable = &__metal_driver_vtable_sifive_clic0.clic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_E24_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e24-rtl/metal-platform.h b/bsp/coreip-e24-rtl/metal-platform.h deleted file mode 100644 index 2f7eb4b..0000000 --- a/bsp/coreip-e24-rtl/metal-platform.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E24_RTL__METAL_PLATFORM_H -#define COREIP_E24_RTL__METAL_PLATFORM_H - -/* From interrupt_controller@2000000 */ -#define METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_0_BASE_ADDRESS 33554432UL -#define METAL_SIFIVE_CLIC0_2000000_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_0_SIZE 16777216UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS 143UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTS 143UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMLEVELS 16UL -#define METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS 4UL -#define METAL_SIFIVE_CLIC0_0_SIFIVE_NUMINTBITS 4UL - -#define METAL_SIFIVE_CLIC0 -#define METAL_SIFIVE_CLIC0_MSIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_MTIMECMP_BASE 16384UL -#define METAL_SIFIVE_CLIC0_MTIME 49144UL -#define METAL_SIFIVE_CLIC0_CLICINTIP_BASE 0UL -#define METAL_SIFIVE_CLIC0_CLICINTIE_BASE 1024UL -#define METAL_SIFIVE_CLIC0_CLICINTCTL_BASE 2048UL -#define METAL_SIFIVE_CLIC0_CLICCFG 3072UL -#define METAL_SIFIVE_CLIC0_MMODE_APERTURE 8388608UL -#define METAL_SIFIVE_CLIC0_HSMODE_APERTURE 10485760UL -#define METAL_SIFIVE_CLIC0_SMODE_APERTURE 12582912UL -#define METAL_SIFIVE_CLIC0_UMODE_APERTURE 14680064UL - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_E24_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e24-rtl/metal.default.lds b/bsp/coreip-e24-rtl/metal.default.lds deleted file mode 100644 index e3965ae..0000000 --- a/bsp/coreip-e24-rtl/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e24-rtl/metal.h b/bsp/coreip-e24-rtl/metal.h deleted file mode 100644 index f493b6d..0000000 --- a/bsp/coreip-e24-rtl/metal.h +++ /dev/null @@ -1,762 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E24_RTL__METAL_H -#define MACROS_IF_COREIP_E24_RTL__METAL_H - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#define __METAL_CLIC_SUBINTERRUPTS 143 - -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E24_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E24_RTL__METAL_H -#define MACROS_ELSE_COREIP_E24_RTL__METAL_H - -#define METAL_MAX_CLINT_INTERRUPTS 0 - -#define __METAL_CLINT_NUM_PARENTS 0 - -#define __METAL_PLIC_SUBINTERRUPTS 0 -#define METAL_MAX_PLIC_INTERRUPTS 0 - -#define __METAL_PLIC_NUM_PARENTS 0 - -#define __METAL_INTERRUPT_CONTROLLER_2000000_INTERRUPTS 3 - -#define __METAL_CLIC_SUBINTERRUPTS 143 - -#define METAL_MAX_CLIC_INTERRUPTS 3 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 127 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 0 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_sys_sram_0_80000000; - -struct metal_memory __metal_dt_mem_sys_sram_1_80008000; - -struct metal_memory __metal_dt_mem_testram_20000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -struct metal_pmp __metal_dt_pmp; - -/* From interrupt_controller@2000000 */ -struct __metal_driver_sifive_clic0 __metal_dt_interrupt_controller_2000000; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 4; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ - - -/* --------------------- sifive_clic0 ------------ */ -static inline unsigned long __metal_driver_sifive_clic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_MAX_CLIC_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clic0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 3; - } - else if (idx == 2) { - return 7; - } - else if (idx == 3) { - return 11; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_max_levels(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMLEVELS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_subinterrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clic0_num_intbits(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_2000000) { - return METAL_SIFIVE_CLIC0_2000000_SIFIVE_NUMINTBITS; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_2000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 0; - } - else if (idx == 1) { - return 1; - } - else if (idx == 2) { - return 2; - } - else if (idx == 3) { - return 3; - } - else if (idx == 4) { - return 4; - } - else if (idx == 5) { - return 5; - } - else if (idx == 6) { - return 6; - } - else if (idx == 7) { - return 7; - } - else if (idx == 8) { - return 8; - } - else if (idx == 9) { - return 9; - } - else if (idx == 10) { - return 10; - } - else if (idx == 11) { - return 11; - } - else if (idx == 12) { - return 12; - } - else if (idx == 13) { - return 13; - } - else if (idx == 14) { - return 14; - } - else if (idx == 15) { - return 15; - } - else if (idx == 16) { - return 16; - } - else if (idx == 17) { - return 17; - } - else if (idx == 18) { - return 18; - } - else if (idx == 19) { - return 19; - } - else if (idx == 20) { - return 20; - } - else if (idx == 21) { - return 21; - } - else if (idx == 22) { - return 22; - } - else if (idx == 23) { - return 23; - } - else if (idx == 24) { - return 24; - } - else if (idx == 25) { - return 25; - } - else if (idx == 26) { - return 26; - } - else if (idx == 27) { - return 27; - } - else if (idx == 28) { - return 28; - } - else if (idx == 29) { - return 29; - } - else if (idx == 30) { - return 30; - } - else if (idx == 31) { - return 31; - } - else if (idx == 32) { - return 32; - } - else if (idx == 33) { - return 33; - } - else if (idx == 34) { - return 34; - } - else if (idx == 35) { - return 35; - } - else if (idx == 36) { - return 36; - } - else if (idx == 37) { - return 37; - } - else if (idx == 38) { - return 38; - } - else if (idx == 39) { - return 39; - } - else if (idx == 40) { - return 40; - } - else if (idx == 41) { - return 41; - } - else if (idx == 42) { - return 42; - } - else if (idx == 43) { - return 43; - } - else if (idx == 44) { - return 44; - } - else if (idx == 45) { - return 45; - } - else if (idx == 46) { - return 46; - } - else if (idx == 47) { - return 47; - } - else if (idx == 48) { - return 48; - } - else if (idx == 49) { - return 49; - } - else if (idx == 50) { - return 50; - } - else if (idx == 51) { - return 51; - } - else if (idx == 52) { - return 52; - } - else if (idx == 53) { - return 53; - } - else if (idx == 54) { - return 54; - } - else if (idx == 55) { - return 55; - } - else if (idx == 56) { - return 56; - } - else if (idx == 57) { - return 57; - } - else if (idx == 58) { - return 58; - } - else if (idx == 59) { - return 59; - } - else if (idx == 60) { - return 60; - } - else if (idx == 61) { - return 61; - } - else if (idx == 62) { - return 62; - } - else if (idx == 63) { - return 63; - } - else if (idx == 64) { - return 64; - } - else if (idx == 65) { - return 65; - } - else if (idx == 66) { - return 66; - } - else if (idx == 67) { - return 67; - } - else if (idx == 68) { - return 68; - } - else if (idx == 69) { - return 69; - } - else if (idx == 70) { - return 70; - } - else if (idx == 71) { - return 71; - } - else if (idx == 72) { - return 72; - } - else if (idx == 73) { - return 73; - } - else if (idx == 74) { - return 74; - } - else if (idx == 75) { - return 75; - } - else if (idx == 76) { - return 76; - } - else if (idx == 77) { - return 77; - } - else if (idx == 78) { - return 78; - } - else if (idx == 79) { - return 79; - } - else if (idx == 80) { - return 80; - } - else if (idx == 81) { - return 81; - } - else if (idx == 82) { - return 82; - } - else if (idx == 83) { - return 83; - } - else if (idx == 84) { - return 84; - } - else if (idx == 85) { - return 85; - } - else if (idx == 86) { - return 86; - } - else if (idx == 87) { - return 87; - } - else if (idx == 88) { - return 88; - } - else if (idx == 89) { - return 89; - } - else if (idx == 90) { - return 90; - } - else if (idx == 91) { - return 91; - } - else if (idx == 92) { - return 92; - } - else if (idx == 93) { - return 93; - } - else if (idx == 94) { - return 94; - } - else if (idx == 95) { - return 95; - } - else if (idx == 96) { - return 96; - } - else if (idx == 97) { - return 97; - } - else if (idx == 98) { - return 98; - } - else if (idx == 99) { - return 99; - } - else if (idx == 100) { - return 100; - } - else if (idx == 101) { - return 101; - } - else if (idx == 102) { - return 102; - } - else if (idx == 103) { - return 103; - } - else if (idx == 104) { - return 104; - } - else if (idx == 105) { - return 105; - } - else if (idx == 106) { - return 106; - } - else if (idx == 107) { - return 107; - } - else if (idx == 108) { - return 108; - } - else if (idx == 109) { - return 109; - } - else if (idx == 110) { - return 110; - } - else if (idx == 111) { - return 111; - } - else if (idx == 112) { - return 112; - } - else if (idx == 113) { - return 113; - } - else if (idx == 114) { - return 114; - } - else if (idx == 115) { - return 115; - } - else if (idx == 116) { - return 116; - } - else if (idx == 117) { - return 117; - } - else if (idx == 118) { - return 118; - } - else if (idx == 119) { - return 119; - } - else if (idx == 120) { - return 120; - } - else if (idx == 121) { - return 121; - } - else if (idx == 122) { - return 122; - } - else if (idx == 123) { - return 123; - } - else if (idx == 124) { - return 124; - } - else if (idx == 125) { - return 125; - } - else if (idx == 126) { - return 126; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_sys_sram_0_80000000, - &__metal_dt_mem_sys_sram_1_80008000, - &__metal_dt_mem_testram_20000000}; - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From interrupt_controller@2000000 */ -#define __METAL_DT_SIFIVE_CLIC0_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_2000000_HANDLE (&__metal_dt_interrupt_controller_2000000.controller) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E24_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e24-rtl/metal.ramrodata.lds b/bsp/coreip-e24-rtl/metal.ramrodata.lds deleted file mode 100644 index 4dde16c..0000000 --- a/bsp/coreip-e24-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >itim AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e24-rtl/metal.scratchpad.lds b/bsp/coreip-e24-rtl/metal.scratchpad.lds deleted file mode 100644 index b4236fd..0000000 --- a/bsp/coreip-e24-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 - itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e24-rtl/settings.mk b/bsp/coreip-e24-rtl/settings.mk deleted file mode 100644 index 1908227..0000000 --- a/bsp/coreip-e24-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imafc -RISCV_ABI=ilp32f -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-2-series - -COREIP_MEM_WIDTH=32 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-e31-arty/README.md b/bsp/coreip-e31-arty/README.md deleted file mode 100644 index c6558cb..0000000 --- a/bsp/coreip-e31-arty/README.md +++ /dev/null @@ -1,14 +0,0 @@ -The SiFive E31 Standard Core is the world’s most deployed RISC-V core. Co-designed alongside the RISC-V ISA, the E31 takes maximum advantage of the RISC-V ISA, resulting in a power-efficient core that delivers the high performance needed for tomorrow’s smart IoT, storage, and industrial applications. - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-e31-arty/design.dts b/bsp/coreip-e31-arty/design.dts deleted file mode 100644 index cf5dcab..0000000 --- a/bsp/coreip-e31-arty/design.dts +++ /dev/null @@ -1,208 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE310G-dev", "fe310-dev", "sifive-dev"; - model = "SiFive,FE310G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L10 0x400000>; - }; - L18: aliases { - serial0 = &L9; - }; - L17: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - next-level-cache = <&L10>; - reg = <0x0>; - riscv,isa = "rv32imac"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <65000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L16: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE310G-soc", "fe310-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L13: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <23 24 25 26>; - }; - L8: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <26>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x8000000 0x4000>; - reg-names = "mem"; - }; - L14: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L11: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <19 20 21 22>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L9: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <17>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L10: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <18>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L8 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L8 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L8 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L8 4>; - interrupts-extended = <&L14 4>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L8 5>; - interrupts-extended = <&L14 5>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L8 6>; - interrupts-extended = <&L14 6>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L8 7>; - interrupts-extended = <&L14 7>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L13 0>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L13 1>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L13 2>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L14 3>; - linux,code = "none"; - }; - L12: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-e31-arty/design.reglist b/bsp/coreip-e31-arty/design.reglist deleted file mode 100644 index 27ab72e..0000000 --- a/bsp/coreip-e31-arty/design.reglist +++ /dev/null @@ -1,227 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e31-arty/metal-inline.h b/bsp/coreip-e31-arty/metal-inline.h deleted file mode 100644 index 0437831..0000000 --- a/bsp/coreip-e31-arty/metal-inline.h +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E31_ARTY__METAL_INLINE_H -#define COREIP_E31_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_E31_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e31-arty/metal-inline1.h b/bsp/coreip-e31-arty/metal-inline1.h deleted file mode 100644 index 7cd8b1f..0000000 --- a/bsp/coreip-e31-arty/metal-inline1.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef ASSEMBLY - -#ifndef COREIP_E31_ARTY1_INLINE_H -#define COREIP_E31_ARTY1_INLINE_H - -#include - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -#endif /* COREIP_E31_ARTY1_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e31-arty/metal-platform.h b/bsp/coreip-e31-arty/metal-platform.h deleted file mode 100644 index e689d43..0000000 --- a/bsp/coreip-e31-arty/metal-platform.h +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E31_ARTY__METAL_PLATFORM_H -#define COREIP_E31_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 27UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 27UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_E31_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e31-arty/metal.default.lds b/bsp/coreip-e31-arty/metal.default.lds deleted file mode 100644 index f5184dc..0000000 --- a/bsp/coreip-e31-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e31-arty/metal.h b/bsp/coreip-e31-arty/metal.h deleted file mode 100644 index 62ccacd..0000000 --- a/bsp/coreip-e31-arty/metal.h +++ /dev/null @@ -1,1027 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E31_ARTY__METAL_H -#define MACROS_IF_COREIP_E31_ARTY__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E31_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E31_ARTY__METAL_H -#define MACROS_ELSE_COREIP_E31_ARTY__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 65000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 23; - } - else if (idx == 1) { - return 24; - } - else if (idx == 2) { - return 25; - } - else if (idx == 3) { - return 26; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 15; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 16; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 1; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 2; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 17; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E31_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e31-arty/metal.ramrodata.lds b/bsp/coreip-e31-arty/metal.ramrodata.lds deleted file mode 100644 index 05895a3..0000000 --- a/bsp/coreip-e31-arty/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e31-arty/metal.scratchpad.lds b/bsp/coreip-e31-arty/metal.scratchpad.lds deleted file mode 100644 index 5d0450d..0000000 --- a/bsp/coreip-e31-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e31-arty/openocd.cfg b/bsp/coreip-e31-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-e31-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-e31-arty/settings.mk b/bsp/coreip-e31-arty/settings.mk deleted file mode 100644 index ebc0e81..0000000 --- a/bsp/coreip-e31-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imac -RISCV_ABI=ilp32 -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-3-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-e31-rtl/README.md b/bsp/coreip-e31-rtl/README.md deleted file mode 100644 index 324369d..0000000 --- a/bsp/coreip-e31-rtl/README.md +++ /dev/null @@ -1,9 +0,0 @@ -The SiFive E31 Standard Core is the world’s most deployed RISC-V core. Co-designed alongside the RISC-V ISA, the E31 takes maximum advantage of the RISC-V ISA, resulting in a power-efficient core that delivers the high performance needed for tomorrow’s smart IoT, storage, and industrial applications. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels diff --git a/bsp/coreip-e31-rtl/design.dts b/bsp/coreip-e31-rtl/design.dts deleted file mode 100644 index 6bfbf1a..0000000 --- a/bsp/coreip-e31-rtl/design.dts +++ /dev/null @@ -1,108 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE310G-dev", "fe310-dev", "sifive-dev"; - model = "SiFive,FE310G"; - L15: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - reg = <0x0>; - riscv,isa = "rv32imac"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L14: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE310G-soc", "fe310-soc", "sifive-soc", "simple-bus"; - ranges; - L12: ahb-periph-port@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-periph-port", "sifive,ahb-port", "sifive,periph-port", "simple-bus"; - ranges = <0x20000000 0x20000000 0x20000000>; - }; - L11: ahb-sys-port@40000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-sys-port", "sifive,ahb-port", "sifive,sys-port", "simple-bus"; - ranges = <0x40000000 0x40000000 0x20000000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L9: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <127>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x8000000 0x4000>; - reg-names = "mem"; - }; - L10: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L8: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x20000000 0x8000000>; - reg-names = "mem"; - word-size-bytes = <4>; - }; - }; -}; diff --git a/bsp/coreip-e31-rtl/design.reglist b/bsp/coreip-e31-rtl/design.reglist deleted file mode 100644 index 27ab72e..0000000 --- a/bsp/coreip-e31-rtl/design.reglist +++ /dev/null @@ -1,227 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e31-rtl/metal-inline.h b/bsp/coreip-e31-rtl/metal-inline.h deleted file mode 100644 index 297b8ea..0000000 --- a/bsp/coreip-e31-rtl/metal-inline.h +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E31_RTL__METAL_INLINE_H -#define COREIP_E31_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 134217728UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_E31_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e31-rtl/metal-platform.h b/bsp/coreip-e31-rtl/metal-platform.h deleted file mode 100644 index 0620e13..0000000 --- a/bsp/coreip-e31-rtl/metal-platform.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E31_RTL__METAL_PLATFORM_H -#define COREIP_E31_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 128UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 128UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_E31_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e31-rtl/metal.default.lds b/bsp/coreip-e31-rtl/metal.default.lds deleted file mode 100644 index 9a50610..0000000 --- a/bsp/coreip-e31-rtl/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e31-rtl/metal.h b/bsp/coreip-e31-rtl/metal.h deleted file mode 100644 index d45a899..0000000 --- a/bsp/coreip-e31-rtl/metal.h +++ /dev/null @@ -1,901 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E31_RTL__METAL_H -#define MACROS_IF_COREIP_E31_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E31_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E31_RTL__METAL_H -#define MACROS_ELSE_COREIP_E31_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_testram_20000000; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_testram_20000000, - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E31_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e31-rtl/metal.ramrodata.lds b/bsp/coreip-e31-rtl/metal.ramrodata.lds deleted file mode 100644 index 2943332..0000000 --- a/bsp/coreip-e31-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e31-rtl/metal.scratchpad.lds b/bsp/coreip-e31-rtl/metal.scratchpad.lds deleted file mode 100644 index 8297de1..0000000 --- a/bsp/coreip-e31-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e31-rtl/settings.mk b/bsp/coreip-e31-rtl/settings.mk deleted file mode 100644 index 51132cb..0000000 --- a/bsp/coreip-e31-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imac -RISCV_ABI=ilp32 -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-3-series - -COREIP_MEM_WIDTH=32 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-e34-arty/README.md b/bsp/coreip-e34-arty/README.md deleted file mode 100644 index ce867af..0000000 --- a/bsp/coreip-e34-arty/README.md +++ /dev/null @@ -1,14 +0,0 @@ -The SiFive E34 Standard Core adds single-precision floating-point to the SiFive E31 Standard Core, the world’s most deployed RISC-V core. The E34 enables advanced applications which require hardware floating-point capabilities such as signal processing and motor control. - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAFC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-e34-arty/design.dts b/bsp/coreip-e34-arty/design.dts deleted file mode 100644 index 4cb0962..0000000 --- a/bsp/coreip-e34-arty/design.dts +++ /dev/null @@ -1,208 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE310G-dev", "fe310-dev", "sifive-dev"; - model = "SiFive,FE310G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L10 0x400000>; - }; - L18: aliases { - serial0 = &L9; - }; - L17: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - next-level-cache = <&L10>; - reg = <0x0>; - riscv,isa = "rv32imafc"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <65000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L16: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE310G-soc", "fe310-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L13: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <23 24 25 26>; - }; - L8: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <26>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x8000000 0x4000>; - reg-names = "mem"; - }; - L14: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L11: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <19 20 21 22>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L9: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <17>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L10: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <18>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L8 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L8 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L8 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L8 4>; - interrupts-extended = <&L14 4>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L8 5>; - interrupts-extended = <&L14 5>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L8 6>; - interrupts-extended = <&L14 6>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L8 7>; - interrupts-extended = <&L14 7>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L13 0>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L13 1>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L13 2>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L14 3>; - linux,code = "none"; - }; - L12: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-e34-arty/design.reglist b/bsp/coreip-e34-arty/design.reglist deleted file mode 100644 index 386db06..0000000 --- a/bsp/coreip-e34-arty/design.reglist +++ /dev/null @@ -1,262 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e34-arty/metal-inline.h b/bsp/coreip-e34-arty/metal-inline.h deleted file mode 100644 index 01195c9..0000000 --- a/bsp/coreip-e34-arty/metal-inline.h +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E34_ARTY__METAL_INLINE_H -#define COREIP_E34_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_E34_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e34-arty/metal-platform.h b/bsp/coreip-e34-arty/metal-platform.h deleted file mode 100644 index 717903d..0000000 --- a/bsp/coreip-e34-arty/metal-platform.h +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E34_ARTY__METAL_PLATFORM_H -#define COREIP_E34_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 27UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 27UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_E34_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e34-arty/metal.default.lds b/bsp/coreip-e34-arty/metal.default.lds deleted file mode 100644 index f5184dc..0000000 --- a/bsp/coreip-e34-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e34-arty/metal.h b/bsp/coreip-e34-arty/metal.h deleted file mode 100644 index 00d76d8..0000000 --- a/bsp/coreip-e34-arty/metal.h +++ /dev/null @@ -1,1027 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E34_ARTY__METAL_H -#define MACROS_IF_COREIP_E34_ARTY__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E34_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E34_ARTY__METAL_H -#define MACROS_ELSE_COREIP_E34_ARTY__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 65000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 23; - } - else if (idx == 1) { - return 24; - } - else if (idx == 2) { - return 25; - } - else if (idx == 3) { - return 26; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 15; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 16; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 1; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 2; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 17; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E34_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e34-arty/metal.ramrodata.lds b/bsp/coreip-e34-arty/metal.ramrodata.lds deleted file mode 100644 index 05895a3..0000000 --- a/bsp/coreip-e34-arty/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e34-arty/metal.scratchpad.lds b/bsp/coreip-e34-arty/metal.scratchpad.lds deleted file mode 100644 index 5d0450d..0000000 --- a/bsp/coreip-e34-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e34-arty/openocd.cfg b/bsp/coreip-e34-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-e34-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-e34-arty/settings.mk b/bsp/coreip-e34-arty/settings.mk deleted file mode 100644 index c1feef7..0000000 --- a/bsp/coreip-e34-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imafc -RISCV_ABI=ilp32f -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-3-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-e34-rtl/README.md b/bsp/coreip-e34-rtl/README.md deleted file mode 100644 index 1953a05..0000000 --- a/bsp/coreip-e34-rtl/README.md +++ /dev/null @@ -1,9 +0,0 @@ -The SiFive E34 Standard Core adds single-precision floating-point to the SiFive E31 Standard Core, the world’s most deployed RISC-V core. The E34 enables advanced applications which require hardware floating-point capabilities such as signal processing and motor control. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAFC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels diff --git a/bsp/coreip-e34-rtl/design.dts b/bsp/coreip-e34-rtl/design.dts deleted file mode 100644 index 745f2b4..0000000 --- a/bsp/coreip-e34-rtl/design.dts +++ /dev/null @@ -1,108 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE340G-dev", "fe340-dev", "sifive-dev"; - model = "SiFive,FE340G"; - L15: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - reg = <0x0>; - riscv,isa = "rv32imafc"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L14: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE340G-soc", "fe340-soc", "sifive-soc", "simple-bus"; - ranges; - L12: ahb-periph-port@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-periph-port", "sifive,ahb-port", "sifive,periph-port", "simple-bus"; - ranges = <0x20000000 0x20000000 0x20000000>; - }; - L11: ahb-sys-port@40000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,ahb-sys-port", "sifive,ahb-port", "sifive,sys-port", "simple-bus"; - ranges = <0x40000000 0x40000000 0x20000000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L9: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <127>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x8000000 0x4000>; - reg-names = "mem"; - }; - L10: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L8: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x20000000 0x8000000>; - reg-names = "mem"; - word-size-bytes = <4>; - }; - }; -}; diff --git a/bsp/coreip-e34-rtl/design.reglist b/bsp/coreip-e34-rtl/design.reglist deleted file mode 100644 index 386db06..0000000 --- a/bsp/coreip-e34-rtl/design.reglist +++ /dev/null @@ -1,262 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e34-rtl/metal-inline.h b/bsp/coreip-e34-rtl/metal-inline.h deleted file mode 100644 index dbc9fb8..0000000 --- a/bsp/coreip-e34-rtl/metal-inline.h +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E34_RTL__METAL_INLINE_H -#define COREIP_E34_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 134217728UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_E34_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e34-rtl/metal-platform.h b/bsp/coreip-e34-rtl/metal-platform.h deleted file mode 100644 index 244123c..0000000 --- a/bsp/coreip-e34-rtl/metal-platform.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E34_RTL__METAL_PLATFORM_H -#define COREIP_E34_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 128UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 128UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_E34_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e34-rtl/metal.default.lds b/bsp/coreip-e34-rtl/metal.default.lds deleted file mode 100644 index 9a50610..0000000 --- a/bsp/coreip-e34-rtl/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e34-rtl/metal.h b/bsp/coreip-e34-rtl/metal.h deleted file mode 100644 index dbaf935..0000000 --- a/bsp/coreip-e34-rtl/metal.h +++ /dev/null @@ -1,901 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E34_RTL__METAL_H -#define MACROS_IF_COREIP_E34_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E34_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E34_RTL__METAL_H -#define MACROS_ELSE_COREIP_E34_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_testram_20000000; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_testram_20000000, - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E34_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e34-rtl/metal.ramrodata.lds b/bsp/coreip-e34-rtl/metal.ramrodata.lds deleted file mode 100644 index 2943332..0000000 --- a/bsp/coreip-e34-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e34-rtl/metal.scratchpad.lds b/bsp/coreip-e34-rtl/metal.scratchpad.lds deleted file mode 100644 index 8297de1..0000000 --- a/bsp/coreip-e34-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x8000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e34-rtl/settings.mk b/bsp/coreip-e34-rtl/settings.mk deleted file mode 100644 index 0d8ec77..0000000 --- a/bsp/coreip-e34-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imafc -RISCV_ABI=ilp32f -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-3-series - -COREIP_MEM_WIDTH=32 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-e76-arty/README.md b/bsp/coreip-e76-arty/README.md deleted file mode 100644 index 3dddb18..0000000 --- a/bsp/coreip-e76-arty/README.md +++ /dev/null @@ -1,16 +0,0 @@ -The SiFive E76 Standard Core is a high-performance 32-bit embedded processor which is fully-compliant with the RISC-V ISA. Its advanced memory subsystem enables inclusion of tightly-integrated memory and caches. - -The E76 is ideal for applications which require high performance -- but have power constraints (e.g., Augmented Reality and Virtual Reality , IoT Edge Compute, Biometric Signal Processing, and Industrial Automation). - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAFC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-e76-arty/design.dts b/bsp/coreip-e76-arty/design.dts deleted file mode 100644 index c1ef3b2..0000000 --- a/bsp/coreip-e76-arty/design.dts +++ /dev/null @@ -1,216 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE710G-dev", "fe710-dev", "sifive-dev"; - model = "SiFive,FE710G"; - L21: aliases { - serial0 = &L13; - }; - L16: chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L14 0x400000>; - }; - L20: cpus { - #address-cells = <1>; - #size-cells = <0>; - L6: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <128>; - d-cache-size = <32768>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <32768>; - next-level-cache = <&L14 &L15>; - reg = <0x0>; - riscv,isa = "rv32imafc"; - riscv,pmpregions = <8>; - status = "okay"; - timebase-frequency = <65000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L15: memory@80000000 { - device_type = "memory"; - reg = <0x80000000 0x10000000>; - }; - L19: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE710G-soc", "fe710-soc", "sifive-soc", "simple-bus"; - ranges; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L10: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <21 22 23 24>; - }; - L17: gpio@10060000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <27 28 29 30>; - reg = <0x10060000 0x1000>; - reg-names = "control"; - }; - L7: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <30>; - }; - L8: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <17 18 19 20>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L11: rom@1000 { - compatible = "sifive,modeselect0"; - reg = <0x1000 0x1000>; - reg-names = "mem"; - }; - L13: serial@20000000 { - clocks = <&L12>; - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <25>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - }; - L14: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - clocks = <&L12>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <26>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L17 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L17 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L17 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L17 4>; - interrupts-extended = <&L10 0>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L17 5>; - interrupts-extended = <&L10 1>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L17 6>; - interrupts-extended = <&L10 2>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L17 7>; - interrupts-extended = <&L10 3>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L10 0>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L10 1>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L10 2>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L10 3>; - linux,code = "none"; - }; - L9: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - L12: tlclk { - #clock-cells = <0>; - clock-frequency = <32500000>; - clock-output-names = "tlclk"; - compatible = "fixed-clock"; - }; - }; -}; diff --git a/bsp/coreip-e76-arty/design.reglist b/bsp/coreip-e76-arty/design.reglist deleted file mode 100644 index 386db06..0000000 --- a/bsp/coreip-e76-arty/design.reglist +++ /dev/null @@ -1,262 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e76-arty/metal-inline.h b/bsp/coreip-e76-arty/metal-inline.h deleted file mode 100644 index e844fd8..0000000 --- a/bsp/coreip-e76-arty/metal-inline.h +++ /dev/null @@ -1,266 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E76_ARTY__METAL_INLINE_H -#define COREIP_E76_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From tlclk */ -struct __metal_driver_fixed_clock __metal_dt_tlclk = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_memory_80000000 = { - ._base_address = 2147483648UL, - ._size = 268435456UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@10060000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_10060000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_E76_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e76-arty/metal-platform.h b/bsp/coreip-e76-arty/metal-platform.h deleted file mode 100644 index 17448df..0000000 --- a/bsp/coreip-e76-arty/metal-platform.h +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E76_ARTY__METAL_PLATFORM_H -#define COREIP_E76_ARTY__METAL_PLATFORM_H - -/* From tlclk */ -#define METAL_FIXED_CLOCK__CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 31UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 31UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@10060000 */ -#define METAL_SIFIVE_GPIO0_10060000_BASE_ADDRESS 268828672UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 268828672UL -#define METAL_SIFIVE_GPIO0_10060000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_1_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_1_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_E76_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e76-arty/metal.default.lds b/bsp/coreip-e76-arty/metal.default.lds deleted file mode 100644 index 34ddf0c..0000000 --- a/bsp/coreip-e76-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :ram_init - - - .itim : - { - *(.itim .itim.*) - } >flash AT>flash :flash - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e76-arty/metal.h b/bsp/coreip-e76-arty/metal.h deleted file mode 100644 index 72473a2..0000000 --- a/bsp/coreip-e76-arty/metal.h +++ /dev/null @@ -1,968 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E76_ARTY__METAL_H -#define MACROS_IF_COREIP_E76_ARTY__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 31 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E76_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E76_ARTY__METAL_H -#define MACROS_ELSE_COREIP_E76_ARTY__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 31 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 0 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_10060000_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From tlclk */ -struct __metal_driver_fixed_clock __metal_dt_tlclk; - -struct metal_memory __metal_dt_mem_memory_80000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@10060000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_10060000; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_tlclk) { - return METAL_FIXED_CLOCK__CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 65000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 21; - } - else if (idx == 1) { - return 22; - } - else if (idx == 2) { - return 23; - } - else if (idx == 3) { - return 24; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return METAL_SIFIVE_GPIO0_10060000_BASE_ADDRESS; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return METAL_SIFIVE_GPIO0_10060000_SIZE; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 0)) { - return 27; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 1))) { - return 28; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 2))) { - return 29; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 3))) { - return 30; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0))) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 15; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 16; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 1; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 2; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 1; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 2; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return (struct metal_clock *)&__metal_dt_tlclk.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 25; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_tlclk.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 2 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_memory_80000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 2 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_10060000, - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E76_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e76-arty/metal.ramrodata.lds b/bsp/coreip-e76-arty/metal.ramrodata.lds deleted file mode 100644 index 3bbe585..0000000 --- a/bsp/coreip-e76-arty/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :ram_init - - - .itim : - { - *(.itim .itim.*) - } >flash AT>flash :flash - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - *(.itim .itim.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e76-arty/metal.scratchpad.lds b/bsp/coreip-e76-arty/metal.scratchpad.lds deleted file mode 100644 index 196c865..0000000 --- a/bsp/coreip-e76-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e76-arty/openocd.cfg b/bsp/coreip-e76-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-e76-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-e76-arty/settings.mk b/bsp/coreip-e76-arty/settings.mk deleted file mode 100644 index 6f6f501..0000000 --- a/bsp/coreip-e76-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imafc -RISCV_ABI=ilp32f -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-7-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-e76-rtl/README.md b/bsp/coreip-e76-rtl/README.md deleted file mode 100644 index cf5b465..0000000 --- a/bsp/coreip-e76-rtl/README.md +++ /dev/null @@ -1,11 +0,0 @@ -The SiFive E76 Standard Core is a high-performance 32-bit embedded processor which is fully-compliant with the RISC-V ISA. Its advanced memory subsystem enables inclusion of tightly-integrated memory and caches. - -The E76 is ideal for applications which require high performance -- but have power constraints (e.g., Augmented Reality and Virtual Reality , IoT Edge Compute, Biometric Signal Processing, and Industrial Automation). - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV32IMAFC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels diff --git a/bsp/coreip-e76-rtl/design.dts b/bsp/coreip-e76-rtl/design.dts deleted file mode 100644 index 25bd59c..0000000 --- a/bsp/coreip-e76-rtl/design.dts +++ /dev/null @@ -1,93 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE710G-dev", "fe710-dev", "sifive-dev"; - model = "SiFive,FE710G"; - L15: cpus { - #address-cells = <1>; - #size-cells = <0>; - L6: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <128>; - d-cache-size = <32768>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <32768>; - next-level-cache = <&L9>; - reg = <0x0>; - riscv,isa = "rv32imafc"; - riscv,pmpregions = <8>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L9: memory@80000000 { - device_type = "memory"; - reg = <0x80000000 0x20000000>; - }; - L14: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FE710G-soc", "fe710-soc", "sifive-soc", "simple-bus"; - ranges; - L11: axi4-periph-port@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,axi4-periph-port", "sifive,axi4-port", "sifive,periph-port", "simple-bus"; - ranges = <0x20000000 0x20000000 0x20000000>; - }; - L10: axi4-sys-port@40000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "sifive,axi4-sys-port", "sifive,axi4-port", "sifive,sys-port", "simple-bus"; - ranges = <0x40000000 0x40000000 0x20000000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L8: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <127>; - }; - L7: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-e76-rtl/design.reglist b/bsp/coreip-e76-rtl/design.reglist deleted file mode 100644 index 386db06..0000000 --- a/bsp/coreip-e76-rtl/design.reglist +++ /dev/null @@ -1,262 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -cycleh -instreth -hpmcounter3h -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -hpmcounter31h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpcfg3 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mcycleh -minstreth -mhpmcounter3h -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -mhpmcounter31h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-e76-rtl/metal-inline.h b/bsp/coreip-e76-rtl/metal-inline.h deleted file mode 100644 index ec12441..0000000 --- a/bsp/coreip-e76-rtl/metal-inline.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_E76_RTL__METAL_INLINE_H -#define COREIP_E76_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_memory_80000000 = { - ._base_address = 2147483648UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_E76_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e76-rtl/metal-platform.h b/bsp/coreip-e76-rtl/metal-platform.h deleted file mode 100644 index 440e8c7..0000000 --- a/bsp/coreip-e76-rtl/metal-platform.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_E76_RTL__METAL_PLATFORM_H -#define COREIP_E76_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 128UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 128UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_E76_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-e76-rtl/metal.default.lds b/bsp/coreip-e76-rtl/metal.default.lds deleted file mode 100644 index 4ff130f..0000000 --- a/bsp/coreip-e76-rtl/metal.default.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e76-rtl/metal.h b/bsp/coreip-e76-rtl/metal.h deleted file mode 100644 index b5740b5..0000000 --- a/bsp/coreip-e76-rtl/metal.h +++ /dev/null @@ -1,809 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_E76_RTL__METAL_H -#define MACROS_IF_COREIP_E76_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_E76_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_E76_RTL__METAL_H -#define MACROS_ELSE_COREIP_E76_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 0 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_memory_80000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 1 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_memory_80000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_E76_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-e76-rtl/metal.ramrodata.lds b/bsp/coreip-e76-rtl/metal.ramrodata.lds deleted file mode 100644 index 84d650e..0000000 --- a/bsp/coreip-e76-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - *(.itim .itim.*) - } >ram AT>ram :ram - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e76-rtl/metal.scratchpad.lds b/bsp/coreip-e76-rtl/metal.scratchpad.lds deleted file mode 100644 index 4ff130f..0000000 --- a/bsp/coreip-e76-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-e76-rtl/settings.mk b/bsp/coreip-e76-rtl/settings.mk deleted file mode 100644 index 20cc72b..0000000 --- a/bsp/coreip-e76-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv32imafc -RISCV_ABI=ilp32f -RISCV_CMODEL=medlow -RISCV_SERIES=sifive-7-series - -COREIP_MEM_WIDTH=64 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-s51-arty/README.md b/bsp/coreip-s51-arty/README.md deleted file mode 100644 index 0290171..0000000 --- a/bsp/coreip-s51-arty/README.md +++ /dev/null @@ -1,14 +0,0 @@ -The SiFive S51 Standard Core is a 64-bit embedded processor, fully compliant with the RISC-V ISA. A small-footprint, low-power design makes the S51 ideal for devices that require a tiny system controller in a larger 64-bit SoC. The S51 can also be used as a standalone controller for networking, storage, or other high-performance embedded applications - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV64IMAC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 255 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-s51-arty/design.dts b/bsp/coreip-s51-arty/design.dts deleted file mode 100644 index 3bcab05..0000000 --- a/bsp/coreip-s51-arty/design.dts +++ /dev/null @@ -1,208 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FS510G-dev", "fs510-dev", "sifive-dev"; - model = "SiFive,FS510G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L10 0x400000>; - }; - L18: aliases { - serial0 = &L9; - }; - L17: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - next-level-cache = <&L10>; - reg = <0x0>; - riscv,isa = "rv64imac"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <65000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L16: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FS510G-soc", "fs510-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L13: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <23 24 25 26>; - }; - L8: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <26>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x8000000 0x4000>; - reg-names = "mem"; - }; - L14: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L11: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <19 20 21 22>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L9: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <17>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L10: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <18>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L8 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L8 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L8 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L8 4>; - interrupts-extended = <&L14 4>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L8 5>; - interrupts-extended = <&L14 5>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L8 6>; - interrupts-extended = <&L14 6>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L8 7>; - interrupts-extended = <&L14 7>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L13 0>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L13 1>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L13 2>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L14 3>; - linux,code = "none"; - }; - L12: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-s51-arty/design.reglist b/bsp/coreip-s51-arty/design.reglist deleted file mode 100644 index 6278819..0000000 --- a/bsp/coreip-s51-arty/design.reglist +++ /dev/null @@ -1,218 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-s51-arty/metal-inline.h b/bsp/coreip-s51-arty/metal-inline.h deleted file mode 100644 index 7dea7c6..0000000 --- a/bsp/coreip-s51-arty/metal-inline.h +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_S51_ARTY__METAL_INLINE_H -#define COREIP_S51_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_S51_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s51-arty/metal-platform.h b/bsp/coreip-s51-arty/metal-platform.h deleted file mode 100644 index 7e61072..0000000 --- a/bsp/coreip-s51-arty/metal-platform.h +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_S51_ARTY__METAL_PLATFORM_H -#define COREIP_S51_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 27UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 27UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_S51_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-s51-arty/metal.default.lds b/bsp/coreip-s51-arty/metal.default.lds deleted file mode 100644 index f5184dc..0000000 --- a/bsp/coreip-s51-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s51-arty/metal.h b/bsp/coreip-s51-arty/metal.h deleted file mode 100644 index f89fb84..0000000 --- a/bsp/coreip-s51-arty/metal.h +++ /dev/null @@ -1,1027 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_S51_ARTY__METAL_H -#define MACROS_IF_COREIP_S51_ARTY__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_S51_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_S51_ARTY__METAL_H -#define MACROS_ELSE_COREIP_S51_ARTY__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 65000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 23; - } - else if (idx == 1) { - return 24; - } - else if (idx == 2) { - return 25; - } - else if (idx == 3) { - return 26; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 15; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 16; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 1; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 2; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 17; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_S51_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s51-arty/metal.ramrodata.lds b/bsp/coreip-s51-arty/metal.ramrodata.lds deleted file mode 100644 index 05895a3..0000000 --- a/bsp/coreip-s51-arty/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s51-arty/metal.scratchpad.lds b/bsp/coreip-s51-arty/metal.scratchpad.lds deleted file mode 100644 index 5d0450d..0000000 --- a/bsp/coreip-s51-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s51-arty/openocd.cfg b/bsp/coreip-s51-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-s51-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-s51-arty/settings.mk b/bsp/coreip-s51-arty/settings.mk deleted file mode 100644 index ae39a55..0000000 --- a/bsp/coreip-s51-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imac -RISCV_ABI=lp64 -RISCV_CMODEL=medany -RISCV_SERIES=sifive-5-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-s51-rtl/README.md b/bsp/coreip-s51-rtl/README.md deleted file mode 100644 index bf808d1..0000000 --- a/bsp/coreip-s51-rtl/README.md +++ /dev/null @@ -1,9 +0,0 @@ -The SiFive S51 Standard Core is a 64-bit embedded processor, fully compliant with the RISC-V ISA. A small-footprint, low-power design makes the S51 ideal for devices that require a tiny system controller in a larger 64-bit SoC. The S51 can also be used as a standalone controller for networking, storage, or other high-performance embedded applications. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV64IMAC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels diff --git a/bsp/coreip-s51-rtl/design.dts b/bsp/coreip-s51-rtl/design.dts deleted file mode 100644 index 3a7bf54..0000000 --- a/bsp/coreip-s51-rtl/design.dts +++ /dev/null @@ -1,108 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FS510G-dev", "fs510-dev", "sifive-dev"; - model = "SiFive,FS510G"; - L15: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - reg = <0x0>; - riscv,isa = "rv64imac"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L14: soc { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FS510G-soc", "fs510-soc", "sifive-soc", "simple-bus"; - ranges; - L12: axi4-periph-port@20000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-periph-port", "sifive,axi4-port", "sifive,periph-port", "simple-bus"; - ranges = <0x0 0x20000000 0x0 0x20000000 0x0 0x20000000 0x1 0x0 0x1 0x0 0xf 0x0>; - }; - L11: axi4-sys-port@40000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-sys-port", "sifive,axi4-port", "sifive,sys-port", "simple-bus"; - ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000 0x10 0x0 0x10 0x0 0xf0 0x0>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x0 0x2000000 0x0 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x0 0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x0 0x80000000 0x0 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x0 0x3000 0x0 0x1000>; - }; - L9: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0x0 0xc000000 0x0 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <127>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x0 0x8000000 0x0 0x4000>; - reg-names = "mem"; - }; - L10: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L8: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x0 0x4000 0x0 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x0 0x20000000 0x0 0x4000000>; - reg-names = "mem"; - word-size-bytes = <8>; - }; - }; -}; diff --git a/bsp/coreip-s51-rtl/design.reglist b/bsp/coreip-s51-rtl/design.reglist deleted file mode 100644 index 6278819..0000000 --- a/bsp/coreip-s51-rtl/design.reglist +++ /dev/null @@ -1,218 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-s51-rtl/metal-inline.h b/bsp/coreip-s51-rtl/metal-inline.h deleted file mode 100644 index 628e386..0000000 --- a/bsp/coreip-s51-rtl/metal-inline.h +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_S51_RTL__METAL_INLINE_H -#define COREIP_S51_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 67108864UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_S51_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s51-rtl/metal-platform.h b/bsp/coreip-s51-rtl/metal-platform.h deleted file mode 100644 index 0ded8d1..0000000 --- a/bsp/coreip-s51-rtl/metal-platform.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_S51_RTL__METAL_PLATFORM_H -#define COREIP_S51_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 128UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 128UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_S51_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-s51-rtl/metal.default.lds b/bsp/coreip-s51-rtl/metal.default.lds deleted file mode 100644 index 0597bb9..0000000 --- a/bsp/coreip-s51-rtl/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x4000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s51-rtl/metal.h b/bsp/coreip-s51-rtl/metal.h deleted file mode 100644 index 584002c..0000000 --- a/bsp/coreip-s51-rtl/metal.h +++ /dev/null @@ -1,901 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_S51_RTL__METAL_H -#define MACROS_IF_COREIP_S51_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_S51_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_S51_RTL__METAL_H -#define MACROS_ELSE_COREIP_S51_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_testram_20000000; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_testram_20000000, - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_S51_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s51-rtl/metal.ramrodata.lds b/bsp/coreip-s51-rtl/metal.ramrodata.lds deleted file mode 100644 index 8f7f2cf..0000000 --- a/bsp/coreip-s51-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x4000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s51-rtl/metal.scratchpad.lds b/bsp/coreip-s51-rtl/metal.scratchpad.lds deleted file mode 100644 index 2b5f355..0000000 --- a/bsp/coreip-s51-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x4000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s51-rtl/settings.mk b/bsp/coreip-s51-rtl/settings.mk deleted file mode 100644 index e50410c..0000000 --- a/bsp/coreip-s51-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imac -RISCV_ABI=lp64 -RISCV_CMODEL=medany -RISCV_SERIES=sifive-5-series - -COREIP_MEM_WIDTH=64 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-s54-arty/README.md b/bsp/coreip-s54-arty/README.md deleted file mode 100644 index 762c776..0000000 --- a/bsp/coreip-s54-arty/README.md +++ /dev/null @@ -1,16 +0,0 @@ -The SiFive S54 Standard Core is a 64-bit embedded processor that is fully-compliant with the RISC-V ISA. It adds support for the F and D standard extensions, which provide the S54 with double-precision floating-point capabilities. - -The S54 is ideal for demanding applications such as avionics, signal processing, and industrial automation. - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV64IMAFDC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-s54-arty/design.dts b/bsp/coreip-s54-arty/design.dts deleted file mode 100644 index 1ae14e2..0000000 --- a/bsp/coreip-s54-arty/design.dts +++ /dev/null @@ -1,208 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FS510G-dev", "fs510-dev", "sifive-dev"; - model = "SiFive,FS510G"; - chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L10 0x400000>; - }; - L18: aliases { - serial0 = &L9; - }; - L17: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - next-level-cache = <&L10>; - reg = <0x0>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <65000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L16: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FS510G-soc", "fs510-soc", "sifive-soc", "simple-bus"; - ranges; - hfclk: clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32500000>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x80000000 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L13: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <23 24 25 26>; - }; - L8: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <26>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x8000000 0x4000>; - reg-names = "mem"; - }; - L14: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L11: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <19 20 21 22>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L9: serial@20000000 { - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <17>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - clocks = <&hfclk>; - }; - L10: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <18>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L8 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L8 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L8 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L8 4>; - interrupts-extended = <&L14 4>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L8 5>; - interrupts-extended = <&L14 5>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L8 6>; - interrupts-extended = <&L14 6>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L8 7>; - interrupts-extended = <&L14 7>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L13 0>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L13 1>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L13 2>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L14 3>; - linux,code = "none"; - }; - L12: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-s54-arty/design.reglist b/bsp/coreip-s54-arty/design.reglist deleted file mode 100644 index a03bc63..0000000 --- a/bsp/coreip-s54-arty/design.reglist +++ /dev/null @@ -1,253 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-s54-arty/metal-inline.h b/bsp/coreip-s54-arty/metal-inline.h deleted file mode 100644 index 2c07b88..0000000 --- a/bsp/coreip-s54-arty/metal-inline.h +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_S54_ARTY__METAL_INLINE_H -#define COREIP_S54_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0 = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_S54_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s54-arty/metal-platform.h b/bsp/coreip-s54-arty/metal-platform.h deleted file mode 100644 index c985f4c..0000000 --- a/bsp/coreip-s54-arty/metal-platform.h +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_S54_ARTY__METAL_PLATFORM_H -#define COREIP_S54_ARTY__METAL_PLATFORM_H - -/* From clock@0 */ -#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 27UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 27UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_S54_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-s54-arty/metal.default.lds b/bsp/coreip-s54-arty/metal.default.lds deleted file mode 100644 index f5184dc..0000000 --- a/bsp/coreip-s54-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s54-arty/metal.h b/bsp/coreip-s54-arty/metal.h deleted file mode 100644 index 1c7cf1f..0000000 --- a/bsp/coreip-s54-arty/metal.h +++ /dev/null @@ -1,1027 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_S54_ARTY__METAL_H -#define MACROS_IF_COREIP_S54_ARTY__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_S54_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_S54_ARTY__METAL_H -#define MACROS_ELSE_COREIP_S54_ARTY__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 27 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From clock@0 */ -struct __metal_driver_fixed_clock __metal_dt_clock_0; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_clock_0) { - return METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 65000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 23; - } - else if (idx == 1) { - return 24; - } - else if (idx == 2) { - return 25; - } - else if (idx == 3) { - return 26; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0)) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 15; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 16; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_20002000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_local_external_interrupts_0; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 1; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 2; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return NULL; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 17; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_clock_0.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 1 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_S54_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s54-arty/metal.ramrodata.lds b/bsp/coreip-s54-arty/metal.ramrodata.lds deleted file mode 100644 index 05895a3..0000000 --- a/bsp/coreip-s54-arty/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s54-arty/metal.scratchpad.lds b/bsp/coreip-s54-arty/metal.scratchpad.lds deleted file mode 100644 index 5d0450d..0000000 --- a/bsp/coreip-s54-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s54-arty/openocd.cfg b/bsp/coreip-s54-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-s54-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-s54-arty/settings.mk b/bsp/coreip-s54-arty/settings.mk deleted file mode 100644 index 7b89fcd..0000000 --- a/bsp/coreip-s54-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imafdc -RISCV_ABI=lp64d -RISCV_CMODEL=medany -RISCV_SERIES=sifive-5-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-s54-rtl/README.md b/bsp/coreip-s54-rtl/README.md deleted file mode 100644 index e04dcf5..0000000 --- a/bsp/coreip-s54-rtl/README.md +++ /dev/null @@ -1,11 +0,0 @@ -The SiFive S54 Standard Core is a 64-bit embedded processor that is fully-compliant with the RISC-V ISA. It adds support for the F and D standard extensions, which provide the S54 with double-precision floating-point capabilities. - -The S54 is ideal for demanding applications such as avionics, signal processing, and industrial automation. - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV64IMAFDC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels diff --git a/bsp/coreip-s54-rtl/design.dts b/bsp/coreip-s54-rtl/design.dts deleted file mode 100644 index 118fe04..0000000 --- a/bsp/coreip-s54-rtl/design.dts +++ /dev/null @@ -1,108 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FS540G-dev", "fs540-dev", "sifive-dev"; - model = "SiFive,FS540G"; - L15: cpus { - #address-cells = <1>; - #size-cells = <0>; - L7: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - reg = <0x0>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,dtim = <&L6>; - sifive,itim = <&L5>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L14: soc { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FS540G-soc", "fs540-soc", "sifive-soc", "simple-bus"; - ranges; - L12: axi4-periph-port@20000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-periph-port", "sifive,axi4-port", "sifive,periph-port", "simple-bus"; - ranges = <0x0 0x20000000 0x0 0x20000000 0x0 0x20000000 0x1 0x0 0x1 0x0 0xf 0x0>; - }; - L11: axi4-sys-port@40000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-sys-port", "sifive,axi4-port", "sifive,sys-port", "simple-bus"; - ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000 0x10 0x0 0x10 0x0 0xf0 0x0>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x0 0x2000000 0x0 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x0 0x0 0x1000>; - reg-names = "control"; - }; - L6: dtim@80000000 { - compatible = "sifive,dtim0"; - reg = <0x0 0x80000000 0x0 0x10000>; - reg-names = "mem"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x0 0x3000 0x0 0x1000>; - }; - L9: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0x0 0xc000000 0x0 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <127>; - }; - L5: itim@8000000 { - compatible = "sifive,itim0"; - reg = <0x0 0x8000000 0x0 0x4000>; - reg-names = "mem"; - }; - L10: local-external-interrupts-0 { - compatible = "sifive,local-external-interrupts0"; - interrupt-parent = <&L4>; - interrupts = <16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31>; - }; - L8: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x0 0x4000 0x0 0x1000>; - reg-names = "control"; - }; - test_memory: testram@20000000 { - compatible = "sifive,testram0"; - reg = <0x0 0x20000000 0x0 0x4000000>; - reg-names = "mem"; - word-size-bytes = <8>; - }; - }; -}; diff --git a/bsp/coreip-s54-rtl/design.reglist b/bsp/coreip-s54-rtl/design.reglist deleted file mode 100644 index a03bc63..0000000 --- a/bsp/coreip-s54-rtl/design.reglist +++ /dev/null @@ -1,253 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-s54-rtl/metal-inline.h b/bsp/coreip-s54-rtl/metal-inline.h deleted file mode 100644 index bd5c6b7..0000000 --- a/bsp/coreip-s54-rtl/metal-inline.h +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_S54_RTL__METAL_INLINE_H -#define COREIP_S54_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -extern inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_testram_20000000 = { - ._base_address = 536870912UL, - ._size = 67108864UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_dtim_80000000 = { - ._base_address = 2147483648UL, - ._size = 65536UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_8000000 = { - ._base_address = 134217728UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0 = { - .irc.vtable = &__metal_driver_vtable_sifive_local_external_interrupts0.local0_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_S54_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s54-rtl/metal-platform.h b/bsp/coreip-s54-rtl/metal-platform.h deleted file mode 100644 index 92391a9..0000000 --- a/bsp/coreip-s54-rtl/metal-platform.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_S54_RTL__METAL_PLATFORM_H -#define COREIP_S54_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 128UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 128UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From local_external_interrupts_0 */ - -#define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_S54_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-s54-rtl/metal.default.lds b/bsp/coreip-s54-rtl/metal.default.lds deleted file mode 100644 index 0597bb9..0000000 --- a/bsp/coreip-s54-rtl/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x4000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s54-rtl/metal.h b/bsp/coreip-s54-rtl/metal.h deleted file mode 100644 index b725025..0000000 --- a/bsp/coreip-s54-rtl/metal.h +++ /dev/null @@ -1,901 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_S54_RTL__METAL_H -#define MACROS_IF_COREIP_S54_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_S54_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_S54_RTL__METAL_H -#define MACROS_ELSE_COREIP_S54_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define __METAL_LOCAL_EXTERNAL_INTERRUPTS_0_INTERRUPTS 16 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 16 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_testram_20000000; - -struct metal_memory __metal_dt_mem_dtim_80000000; - -struct metal_memory __metal_dt_mem_itim_8000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From local_external_interrupts_0 */ -struct __metal_driver_sifive_local_external_interrupts0 __metal_dt_local_external_interrupts_0; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ -static inline struct metal_interrupt * __metal_driver_sifive_local_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_local_external_interrupts_0) { - return METAL_MAX_LOCAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_local_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 16; - } - else if (idx == 1) { - return 17; - } - else if (idx == 2) { - return 18; - } - else if (idx == 3) { - return 19; - } - else if (idx == 4) { - return 20; - } - else if (idx == 5) { - return 21; - } - else if (idx == 6) { - return 22; - } - else if (idx == 7) { - return 23; - } - else if (idx == 8) { - return 24; - } - else if (idx == 9) { - return 25; - } - else if (idx == 10) { - return 26; - } - else if (idx == 11) { - return 27; - } - else if (idx == 12) { - return 28; - } - else if (idx == 13) { - return 29; - } - else if (idx == 14) { - return 30; - } - else if (idx == 15) { - return 31; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 3 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_testram_20000000, - &__metal_dt_mem_dtim_80000000, - &__metal_dt_mem_itim_8000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From local_external_interrupts_0 */ -#define __METAL_DT_SIFIVE_LOCAL_EXINTR0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -#define __METAL_DT_LOCAL_EXTERNAL_INTERRUPTS_0_HANDLE (&__metal_dt_local_external_interrupts_0.irc) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_S54_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s54-rtl/metal.ramrodata.lds b/bsp/coreip-s54-rtl/metal.ramrodata.lds deleted file mode 100644 index 8f7f2cf..0000000 --- a/bsp/coreip-s54-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x4000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>flash :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s54-rtl/metal.scratchpad.lds b/bsp/coreip-s54-rtl/metal.scratchpad.lds deleted file mode 100644 index 2b5f355..0000000 --- a/bsp/coreip-s54-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 - itim (wx!rai) : ORIGIN = 0x8000000, LENGTH = 0x4000 - flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 0x4000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s54-rtl/settings.mk b/bsp/coreip-s54-rtl/settings.mk deleted file mode 100644 index f5c6d8d..0000000 --- a/bsp/coreip-s54-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imafdc -RISCV_ABI=lp64d -RISCV_CMODEL=medany -RISCV_SERIES=sifive-5-series - -COREIP_MEM_WIDTH=64 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-s76-arty/README.md b/bsp/coreip-s76-arty/README.md deleted file mode 100644 index 67be221..0000000 --- a/bsp/coreip-s76-arty/README.md +++ /dev/null @@ -1,16 +0,0 @@ -The SiFive S76 Standard Core is a high-performance 64-bit embedded processor which is fully-compliant with the RISC-V ISA. - -The S76 is ideal for latency-sensitive applications in domains such as storage and networking that require 64-bit memory addressability (e.g. In-storage Compute, Edge Compute, 5G Modems, Object storage etc.) - -This FPGA core target is ideal for makers and hobbyists to develop running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV64IMAFDC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels -- GPIO memory with 16 interrupt lines -- SPI memory with 1 interrupt line -- Serial port with 1 interrupt line -- 4 RGB LEDS -- 4 Buttons and 4 Switches diff --git a/bsp/coreip-s76-arty/design.dts b/bsp/coreip-s76-arty/design.dts deleted file mode 100644 index 00ed9ee..0000000 --- a/bsp/coreip-s76-arty/design.dts +++ /dev/null @@ -1,216 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FS760G-dev", "fs710-dev", "sifive-dev"; - model = "SiFive,FS760G"; - L21: aliases { - serial0 = &L13; - }; - L16: chosen { - stdout-path = "/soc/serial@20000000:115200"; - metal,entry = <&L14 0x400000>; - }; - L20: cpus { - #address-cells = <1>; - #size-cells = <0>; - L6: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <128>; - d-cache-size = <32768>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <32768>; - next-level-cache = <&L14 &L15>; - reg = <0x0>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - status = "okay"; - timebase-frequency = <65000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L15: memory@80000000 { - device_type = "memory"; - reg = <0x80000000 0x10000000>; - }; - L19: soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "SiFive,FS760G-soc", "fs710-soc", "sifive-soc", "simple-bus"; - ranges; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x2000000 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x3000 0x1000>; - }; - L10: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <21 22 23 24>; - }; - L17: gpio@10060000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <27 28 29 30>; - reg = <0x10060000 0x1000>; - reg-names = "control"; - }; - L7: gpio@20002000 { - #gpio-cells = <2>; - #interrupt-cells = <2>; - compatible = "sifive,gpio0", "sifive,gpio1"; - gpio-controller; - interrupt-controller; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16>; - reg = <0x20002000 0x1000>; - reg-names = "control"; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0xc000000 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <30>; - }; - L8: pwm@20005000 { - compatible = "sifive,pwm0"; - interrupt-parent = <&L1>; - interrupts = <17 18 19 20>; - reg = <0x20005000 0x1000>; - reg-names = "control"; - }; - L11: rom@1000 { - compatible = "sifive,modeselect0"; - reg = <0x1000 0x1000>; - reg-names = "mem"; - }; - L13: serial@20000000 { - clocks = <&L12>; - compatible = "sifive,uart0"; - interrupt-parent = <&L1>; - interrupts = <25>; - reg = <0x20000000 0x1000>; - reg-names = "control"; - }; - L14: spi@20004000 { - #address-cells = <1>; - #size-cells = <0>; - clocks = <&L12>; - compatible = "sifive,spi0"; - interrupt-parent = <&L1>; - interrupts = <26>; - reg = <0x20004000 0x1000 0x40000000 0x20000000>; - reg-names = "control", "mem"; - }; - led@0red { - compatible = "sifive,gpio-leds"; - label = "LD0red"; - gpios = <&L17 0>; - linux,default-trigger = "none"; - }; - led@0green { - compatible = "sifive,gpio-leds"; - label = "LD0green"; - gpios = <&L17 1>; - linux,default-trigger = "none"; - }; - led@0blue { - compatible = "sifive,gpio-leds"; - label = "LD0blue"; - gpios = <&L17 2>; - linux,default-trigger = "none"; - }; - button@0 { - compatible = "sifive,gpio-buttons"; - label = "BTN0"; - gpios = <&L17 4>; - interrupts-extended = <&L10 0>; - linux,code = "none"; - }; - button@1 { - compatible = "sifive,gpio-buttons"; - label = "BTN1"; - gpios = <&L17 5>; - interrupts-extended = <&L10 1>; - linux,code = "none"; - }; - button@2 { - compatible = "sifive,gpio-buttons"; - label = "BTN2"; - gpios = <&L17 6>; - interrupts-extended = <&L10 2>; - linux,code = "none"; - }; - button@3 { - compatible = "sifive,gpio-buttons"; - label = "BTN3"; - gpios = <&L17 7>; - interrupts-extended = <&L10 3>; - linux,code = "none"; - }; - switch@0 { - compatible = "sifive,gpio-switches"; - label = "SW0"; - interrupts-extended = <&L10 0>; - linux,code = "none"; - }; - switch@1 { - compatible = "sifive,gpio-switches"; - label = "SW1"; - interrupts-extended = <&L10 1>; - linux,code = "none"; - }; - switch@2 { - compatible = "sifive,gpio-switches"; - label = "SW2"; - interrupts-extended = <&L10 2>; - linux,code = "none"; - }; - switch@3 { - compatible = "sifive,gpio-switches"; - label = "SW3"; - interrupts-extended = <&L10 3>; - linux,code = "none"; - }; - L9: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x4000 0x1000>; - reg-names = "control"; - }; - L12: tlclk { - #clock-cells = <0>; - clock-frequency = <32500000>; - clock-output-names = "tlclk"; - compatible = "fixed-clock"; - }; - }; -}; diff --git a/bsp/coreip-s76-arty/design.reglist b/bsp/coreip-s76-arty/design.reglist deleted file mode 100644 index a03bc63..0000000 --- a/bsp/coreip-s76-arty/design.reglist +++ /dev/null @@ -1,253 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-s76-arty/metal-inline.h b/bsp/coreip-s76-arty/metal-inline.h deleted file mode 100644 index 4b957f0..0000000 --- a/bsp/coreip-s76-arty/metal-inline.h +++ /dev/null @@ -1,266 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_S76_ARTY__METAL_INLINE_H -#define COREIP_S76_ARTY__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ -extern inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock); - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ -extern inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio); -extern inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio); -extern inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx); - - -/* --------------------- sifive_gpio_button ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button); -extern inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button); -extern inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button); - - -/* --------------------- sifive_gpio_led ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led); -extern inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led); -extern inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led); - - -/* --------------------- sifive_gpio_switch ------------ */ -extern inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip); -extern inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip); -extern inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip); -extern inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip); - - -/* --------------------- sifive_spi0 ------------ */ -extern inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi); -extern inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi); - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ -extern inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart); -extern inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart); -extern inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart); -extern inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart); -extern inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart); -extern inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart); - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -/* From tlclk */ -struct __metal_driver_fixed_clock __metal_dt_tlclk = { - .clock.vtable = &__metal_driver_vtable_fixed_clock.clock, -}; - -struct metal_memory __metal_dt_mem_memory_80000000 = { - ._base_address = 2147483648UL, - ._size = 268435456UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_spi_20004000 = { - ._base_address = 1073741824UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From gpio@10060000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_10060000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000 = { - .gpio.vtable = &__metal_driver_vtable_sifive_gpio0.gpio, -}; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3 = { - .button.vtable = &__metal_driver_vtable_sifive_button.button_vtable, -}; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue = { - .led.vtable = &__metal_driver_vtable_sifive_led.led_vtable, -}; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3 = { - .flip.vtable = &__metal_driver_vtable_sifive_switch.switch_vtable, -}; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000 = { - .spi.vtable = &__metal_driver_vtable_sifive_spi0.spi, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000 = { - .uart.vtable = &__metal_driver_vtable_sifive_uart0.uart, -}; - - -#endif /* COREIP_S76_ARTY__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s76-arty/metal-platform.h b/bsp/coreip-s76-arty/metal-platform.h deleted file mode 100644 index 7e1489b..0000000 --- a/bsp/coreip-s76-arty/metal-platform.h +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_S76_ARTY__METAL_PLATFORM_H -#define COREIP_S76_ARTY__METAL_PLATFORM_H - -/* From tlclk */ -#define METAL_FIXED_CLOCK__CLOCK_FREQUENCY 32500000UL - -#define METAL_FIXED_CLOCK - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 31UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 31UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From gpio@10060000 */ -#define METAL_SIFIVE_GPIO0_10060000_BASE_ADDRESS 268828672UL -#define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 268828672UL -#define METAL_SIFIVE_GPIO0_10060000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_0_SIZE 4096UL - -/* From gpio@20002000 */ -#define METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_1_BASE_ADDRESS 536879104UL -#define METAL_SIFIVE_GPIO0_20002000_SIZE 4096UL -#define METAL_SIFIVE_GPIO0_1_SIZE 4096UL - -#define METAL_SIFIVE_GPIO0 -#define METAL_SIFIVE_GPIO0_VALUE 0UL -#define METAL_SIFIVE_GPIO0_INPUT_EN 4UL -#define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL -#define METAL_SIFIVE_GPIO0_PORT 12UL -#define METAL_SIFIVE_GPIO0_PUE 16UL -#define METAL_SIFIVE_GPIO0_DS 20UL -#define METAL_SIFIVE_GPIO0_RISE_IE 24UL -#define METAL_SIFIVE_GPIO0_RISE_IP 28UL -#define METAL_SIFIVE_GPIO0_FALL_IE 32UL -#define METAL_SIFIVE_GPIO0_FALL_IP 36UL -#define METAL_SIFIVE_GPIO0_HIGH_IE 40UL -#define METAL_SIFIVE_GPIO0_HIGH_IP 44UL -#define METAL_SIFIVE_GPIO0_LOW_IE 48UL -#define METAL_SIFIVE_GPIO0_LOW_IP 52UL -#define METAL_SIFIVE_GPIO0_IOF_EN 56UL -#define METAL_SIFIVE_GPIO0_IOF_SEL 60UL -#define METAL_SIFIVE_GPIO0_OUT_XOR 64UL - -/* From button@0 */ - -/* From button@1 */ - -/* From button@2 */ - -/* From button@3 */ - -#define METAL_SIFIVE_GPIO_BUTTONS - -/* From led@0red */ - -/* From led@0green */ - -/* From led@0blue */ - -#define METAL_SIFIVE_GPIO_LEDS - -/* From switch@0 */ - -/* From switch@1 */ - -/* From switch@2 */ - -/* From switch@3 */ - -#define METAL_SIFIVE_GPIO_SWITCHES - -/* From pwm@20005000 */ -#define METAL_SIFIVE_PWM0_20005000_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 536891392UL -#define METAL_SIFIVE_PWM0_20005000_SIZE 4096UL -#define METAL_SIFIVE_PWM0_0_SIZE 4096UL - -#define METAL_SIFIVE_PWM0 -#define METAL_SIFIVE_PWM0_PWMCFG 0UL -#define METAL_SIFIVE_PWM0_PWMCOUNT 8UL -#define METAL_SIFIVE_PWM0_PWMS 16UL -#define METAL_SIFIVE_PWM0_PWMCMP0 32UL -#define METAL_SIFIVE_PWM0_PWMCMP1 36UL -#define METAL_SIFIVE_PWM0_PWMCMP2 40UL -#define METAL_SIFIVE_PWM0_PWMCMP3 44UL - -/* From spi@20004000 */ -#define METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 536887296UL -#define METAL_SIFIVE_SPI0_20004000_SIZE 4096UL -#define METAL_SIFIVE_SPI0_0_SIZE 4096UL - -#define METAL_SIFIVE_SPI0 -#define METAL_SIFIVE_SPI0_SCKDIV 0UL -#define METAL_SIFIVE_SPI0_SCKMODE 4UL -#define METAL_SIFIVE_SPI0_CSID 16UL -#define METAL_SIFIVE_SPI0_CSDEF 20UL -#define METAL_SIFIVE_SPI0_CSMODE 24UL -#define METAL_SIFIVE_SPI0_DELAY0 40UL -#define METAL_SIFIVE_SPI0_DELAY1 44UL -#define METAL_SIFIVE_SPI0_FMT 64UL -#define METAL_SIFIVE_SPI0_TXDATA 72UL -#define METAL_SIFIVE_SPI0_RXDATA 76UL -#define METAL_SIFIVE_SPI0_TXMARK 80UL -#define METAL_SIFIVE_SPI0_RXMARK 84UL -#define METAL_SIFIVE_SPI0_FCTRL 96UL -#define METAL_SIFIVE_SPI0_FFMT 100UL -#define METAL_SIFIVE_SPI0_IE 112UL -#define METAL_SIFIVE_SPI0_IP 116UL - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -/* From serial@20000000 */ -#define METAL_SIFIVE_UART0_20000000_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_0_BASE_ADDRESS 536870912UL -#define METAL_SIFIVE_UART0_20000000_SIZE 4096UL -#define METAL_SIFIVE_UART0_0_SIZE 4096UL - -#define METAL_SIFIVE_UART0 -#define METAL_SIFIVE_UART0_TXDATA 0UL -#define METAL_SIFIVE_UART0_RXDATA 4UL -#define METAL_SIFIVE_UART0_TXCTRL 8UL -#define METAL_SIFIVE_UART0_RXCTRL 12UL -#define METAL_SIFIVE_UART0_IE 16UL -#define METAL_SIFIVE_UART0_IP 20UL -#define METAL_SIFIVE_UART0_DIV 24UL - -#endif /* COREIP_S76_ARTY__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-s76-arty/metal.default.lds b/bsp/coreip-s76-arty/metal.default.lds deleted file mode 100644 index 34ddf0c..0000000 --- a/bsp/coreip-s76-arty/metal.default.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >flash AT>flash :flash - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >flash AT>flash :flash - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :ram_init - - - .itim : - { - *(.itim .itim.*) - } >flash AT>flash :flash - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s76-arty/metal.h b/bsp/coreip-s76-arty/metal.h deleted file mode 100644 index b233fa8..0000000 --- a/bsp/coreip-s76-arty/metal.h +++ /dev/null @@ -1,968 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_S76_ARTY__METAL_H -#define MACROS_IF_COREIP_S76_ARTY__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 31 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_S76_ARTY__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_S76_ARTY__METAL_H -#define MACROS_ELSE_COREIP_S76_ARTY__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 31 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 0 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 4 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 4 - -#define __METAL_GPIO_10060000_INTERRUPTS 4 - -#define __METAL_GPIO_20002000_INTERRUPTS 16 - -#define METAL_MAX_GPIO_INTERRUPTS 16 - -#define __METAL_SERIAL_20000000_INTERRUPTS 1 - -#define METAL_MAX_UART_INTERRUPTS 1 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* From tlclk */ -struct __metal_driver_fixed_clock __metal_dt_tlclk; - -struct metal_memory __metal_dt_mem_memory_80000000; - -struct metal_memory __metal_dt_mem_spi_20004000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From gpio@10060000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_10060000; - -/* From gpio@20002000 */ -struct __metal_driver_sifive_gpio0 __metal_dt_gpio_20002000; - -/* From button@0 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_0; - -/* From button@1 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_1; - -/* From button@2 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_2; - -/* From button@3 */ -struct __metal_driver_sifive_gpio_button __metal_dt_button_3; - -/* From led@0red */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0red; - -/* From led@0green */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0green; - -/* From led@0blue */ -struct __metal_driver_sifive_gpio_led __metal_dt_led_0blue; - -/* From switch@0 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_0; - -/* From switch@1 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_1; - -/* From switch@2 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_2; - -/* From switch@3 */ -struct __metal_driver_sifive_gpio_switch __metal_dt_switch_3; - -/* From spi@20004000 */ -struct __metal_driver_sifive_spi0 __metal_dt_spi_20004000; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From serial@20000000 */ -struct __metal_driver_sifive_uart0 __metal_dt_serial_20000000; - - - -/* --------------------- fixed_clock ------------ */ -static inline unsigned long __metal_driver_fixed_clock_rate(struct metal_clock *clock) -{ - if ((uintptr_t)clock == (uintptr_t)&__metal_dt_tlclk) { - return METAL_FIXED_CLOCK__CLOCK_FREQUENCY; - } - else { - return 0; - } -} - - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 65000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 21; - } - else if (idx == 1) { - return 22; - } - else if (idx == 2) { - return 23; - } - else if (idx == 3) { - return 24; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ -static inline unsigned long __metal_driver_sifive_gpio0_base(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return METAL_SIFIVE_GPIO0_10060000_BASE_ADDRESS; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_gpio0_size(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return METAL_SIFIVE_GPIO0_10060000_SIZE; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_SIFIVE_GPIO0_20002000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_num_interrupts(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return METAL_MAX_GPIO_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio0_interrupt_parent(struct metal_gpio *gpio) -{ - if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else if ((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_gpio0_interrupt_lines(struct metal_gpio *gpio, int idx) -{ - if (((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 0)) { - return 27; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 1))) { - return 28; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 2))) { - return 29; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_10060000) && (idx == 3))) { - return 30; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 0))) { - return 1; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 1))) { - return 2; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 2))) { - return 3; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 3))) { - return 4; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 4))) { - return 5; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 5))) { - return 6; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 6))) { - return 7; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 7))) { - return 8; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 8))) { - return 9; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 9))) { - return 10; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 10))) { - return 11; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 11))) { - return 12; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 12))) { - return 13; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 13))) { - return 14; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 14))) { - return 15; - } - else if ((((uintptr_t)gpio == (uintptr_t)&__metal_dt_gpio_20002000) && (idx == 15))) { - return 16; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio_button ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_button_gpio(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_pin(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 4; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 5; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 6; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 7; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_button_interrupt_controller(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_button_interrupt_line(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return 0; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return 1; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return 2; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_button_label(struct metal_button *button) -{ - if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_0) { - return "BTN0"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_1) { - return "BTN1"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_2) { - return "BTN2"; - } - else if ((uintptr_t)button == (uintptr_t)&__metal_dt_button_3) { - return "BTN3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_led ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_led_gpio(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return (struct metal_gpio *)&__metal_dt_gpio_10060000; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_led_pin(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return 0; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return 1; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return 2; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_led_label(struct metal_led *led) -{ - if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0red) { - return "LD0red"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0green) { - return "LD0green"; - } - else if ((uintptr_t)led == (uintptr_t)&__metal_dt_led_0blue) { - return "LD0blue"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_gpio_switch ------------ */ -static inline struct metal_gpio * __metal_driver_sifive_gpio_switch_gpio(struct metal_switch *flip) -{ - return NULL; -} - -static inline int __metal_driver_sifive_gpio_switch_pin(struct metal_switch *flip) -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_gpio_switch_interrupt_controller(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return (struct metal_interrupt *)&__metal_dt_global_external_interrupts; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_gpio_switch_interrupt_line(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return 0; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return 1; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return 2; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return 3; - } - else { - return 0; - } -} - -static inline char * __metal_driver_sifive_gpio_switch_label(struct metal_switch *flip) -{ - if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_0) { - return "SW0"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_1) { - return "SW1"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_2) { - return "SW2"; - } - else if ((uintptr_t)flip == (uintptr_t)&__metal_dt_switch_3) { - return "SW3"; - } - else { - return ""; - } -} - - - -/* --------------------- sifive_spi0 ------------ */ -static inline unsigned long __metal_driver_sifive_spi0_control_base(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_spi0_control_size(struct metal_spi *spi) -{ - if ((uintptr_t)spi == (uintptr_t)&__metal_dt_spi_20004000) { - return METAL_SIFIVE_SPI0_20004000_SIZE; - } - else { - return 0; - } -} - -static inline struct metal_clock * __metal_driver_sifive_spi0_clock(struct metal_spi *spi) -{ - return (struct metal_clock *)&__metal_dt_tlclk.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_spi0_pinmux(struct metal_spi *spi) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_output_selector(struct metal_spi *spi) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_spi0_pinmux_source_selector(struct metal_spi *spi) -{ - return 0; -} - - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ -static inline unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_SIFIVE_UART0_20000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_uart0_num_interrupts(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return METAL_MAX_UART_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_uart0_interrupt_parent(struct metal_uart *uart) -{ - if ((uintptr_t)uart == (uintptr_t)&__metal_dt_serial_20000000) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_uart0_interrupt_line(struct metal_uart *uart) -{ - return 25; -} - -static inline struct metal_clock * __metal_driver_sifive_uart0_clock(struct metal_uart *uart) -{ - return (struct metal_clock *)&__metal_dt_tlclk.clock; -} - -static inline struct __metal_driver_sifive_gpio0 * __metal_driver_sifive_uart0_pinmux(struct metal_uart *uart) -{ - return NULL; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_output_selector(struct metal_uart *uart) -{ - return 0; -} - -static inline unsigned long __metal_driver_sifive_uart0_pinmux_source_selector(struct metal_uart *uart) -{ - return 0; -} - - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 2 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_memory_80000000, - &__metal_dt_mem_spi_20004000}; - -/* From serial@20000000 */ -#define __METAL_DT_STDOUT_UART_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_SERIAL_20000000_HANDLE (&__metal_dt_serial_20000000.uart) - -#define __METAL_DT_STDOUT_UART_BAUD 115200 - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 2 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - &__metal_dt_gpio_10060000, - &__metal_dt_gpio_20002000}; - -#define __METAL_DT_MAX_BUTTONS 4 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - &__metal_dt_button_0, - &__metal_dt_button_1, - &__metal_dt_button_2, - &__metal_dt_button_3}; - -#define __METAL_DT_MAX_LEDS 3 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - &__metal_dt_led_0red, - &__metal_dt_led_0green, - &__metal_dt_led_0blue}; - -#define __METAL_DT_MAX_SWITCHES 4 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - &__metal_dt_switch_0, - &__metal_dt_switch_1, - &__metal_dt_switch_2, - &__metal_dt_switch_3}; - -#define __METAL_DT_MAX_SPIS 1 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - &__metal_dt_spi_20004000}; - -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_S76_ARTY__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s76-arty/metal.ramrodata.lds b/bsp/coreip-s76-arty/metal.ramrodata.lds deleted file mode 100644 index 3bbe585..0000000 --- a/bsp/coreip-s76-arty/metal.ramrodata.lds +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_NULL; - itim PT_NULL; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >flash AT>flash :flash - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >flash AT>flash :flash - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >flash AT>flash :flash - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >flash AT>flash :flash - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >flash AT>flash :flash - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >flash AT>flash :flash - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >flash AT>flash :flash - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :ram_init - - - .itim : - { - *(.itim .itim.*) - } >flash AT>flash :flash - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - *(.itim .itim.*) - } >flash AT>flash :flash - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>flash :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s76-arty/metal.scratchpad.lds b/bsp/coreip-s76-arty/metal.scratchpad.lds deleted file mode 100644 index 196c865..0000000 --- a/bsp/coreip-s76-arty/metal.scratchpad.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s76-arty/openocd.cfg b/bsp/coreip-s76-arty/openocd.cfg deleted file mode 100644 index 34b9f88..0000000 --- a/bsp/coreip-s76-arty/openocd.cfg +++ /dev/null @@ -1,30 +0,0 @@ -adapter_khz 10000 - -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - -interface ftdi -ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" -ftdi_vid_pid 0x15ba 0x002a - -ftdi_layout_init 0x0808 0x0a1b -ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 -ftdi_layout_signal LED -data 0x0800 -# - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -flash bank my_first_flash fespi 0x40000000 0 0 0 $_TARGETNAME 0x20004000 -init -#reset -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -#flash protect 0 64 last off diff --git a/bsp/coreip-s76-arty/settings.mk b/bsp/coreip-s76-arty/settings.mk deleted file mode 100644 index 815c0fe..0000000 --- a/bsp/coreip-s76-arty/settings.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imafdc -RISCV_ABI=lp64d -RISCV_CMODEL=medany -RISCV_SERIES=sifive-7-series - -TARGET_TAGS=fpga openocd -TARGET_DHRY_ITERS=20000000 -TARGET_CORE_ITERS=5000 diff --git a/bsp/coreip-s76-rtl/README.md b/bsp/coreip-s76-rtl/README.md deleted file mode 100644 index 9623a83..0000000 --- a/bsp/coreip-s76-rtl/README.md +++ /dev/null @@ -1,11 +0,0 @@ -The SiFive S76 Standard Core is a high-performance 64-bit embedded processor which is fully-compliant with the RISC-V ISA. - -The S76 is ideal for latency-sensitive applications in domains such as storage and networking that require 64-bit memory addressability (e.g. In-storage Compute, Edge Compute, 5G Modems, Object storage etc.) - -This core target is suitable with Verilog RTL for verification and running application software building on top of freedom-metal libraries. The target supports: - -- 1 hart with RV64IMAFDC core -- 4 hardware breakpoints -- Physical Memory Protection with 8 regions -- 16 local interrupts signal that can be connected to off core complex devices -- Up to 127 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels diff --git a/bsp/coreip-s76-rtl/design.dts b/bsp/coreip-s76-rtl/design.dts deleted file mode 100644 index 690b6a4..0000000 --- a/bsp/coreip-s76-rtl/design.dts +++ /dev/null @@ -1,93 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FS760G-dev", "fs710-dev", "sifive-dev"; - model = "SiFive,FS760G"; - L15: cpus { - #address-cells = <1>; - #size-cells = <0>; - L6: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <128>; - d-cache-size = <32768>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <32768>; - next-level-cache = <&L9>; - reg = <0x0>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - status = "okay"; - timebase-frequency = <1000000>; - hardware-exec-breakpoint-count = <4>; - L4: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L9: memory@80000000 { - device_type = "memory"; - reg = <0x0 0x80000000 0x0 0x20000000>; - }; - L14: soc { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FS760G-soc", "fs710-soc", "sifive-soc", "simple-bus"; - ranges; - L11: axi4-periph-port@20000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-periph-port", "sifive,axi4-port", "sifive,periph-port", "simple-bus"; - ranges = <0x0 0x20000000 0x0 0x20000000 0x0 0x20000000 0x1 0x0 0x1 0x0 0xf 0x0>; - }; - L10: axi4-sys-port@40000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-sys-port", "sifive,axi4-port", "sifive,sys-port", "simple-bus"; - ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000 0x10 0x0 0x10 0x0 0xf0 0x0>; - }; - L2: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L4 3 &L4 7>; - reg = <0x0 0x2000000 0x0 0x10000>; - reg-names = "control"; - }; - L3: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L4 65535>; - reg = <0x0 0x0 0x0 0x1000>; - reg-names = "control"; - }; - L0: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x0 0x3000 0x0 0x1000>; - }; - L8: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L1>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L1: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L4 11>; - reg = <0x0 0xc000000 0x0 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <127>; - }; - L7: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x0 0x4000 0x0 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-s76-rtl/design.reglist b/bsp/coreip-s76-rtl/design.reglist deleted file mode 100644 index a03bc63..0000000 --- a/bsp/coreip-s76-rtl/design.reglist +++ /dev/null @@ -1,253 +0,0 @@ -zero -ra -sp -gp -tp -t0 -t1 -t2 -fp -s1 -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -s2 -s3 -s4 -s5 -s6 -s7 -s8 -s9 -s10 -s11 -t3 -t4 -t5 -t6 -pc -ft0 -ft1 -ft2 -ft3 -ft4 -ft5 -ft6 -ft7 -fs0 -fs1 -fa0 -fa1 -fa2 -fa3 -fa4 -fa5 -fa6 -fa7 -fs2 -fs3 -fs4 -fs5 -fs6 -fs7 -fs8 -fs9 -fs10 -fs11 -ft8 -ft9 -ft10 -ft11 -fflags -frm -fcsr -mscratch -mtval -cycle -instret -hpmcounter3 -hpmcounter4 -hpmcounter5 -hpmcounter6 -hpmcounter7 -hpmcounter8 -hpmcounter9 -hpmcounter10 -hpmcounter11 -hpmcounter12 -hpmcounter13 -hpmcounter14 -hpmcounter15 -hpmcounter16 -hpmcounter17 -hpmcounter18 -hpmcounter19 -hpmcounter20 -hpmcounter21 -hpmcounter22 -hpmcounter23 -hpmcounter24 -hpmcounter25 -hpmcounter26 -hpmcounter27 -hpmcounter28 -hpmcounter29 -hpmcounter30 -hpmcounter31 -hpmcounter4h -hpmcounter5h -hpmcounter6h -hpmcounter7h -hpmcounter8h -hpmcounter9h -hpmcounter10h -hpmcounter11h -hpmcounter12h -hpmcounter13h -hpmcounter14h -hpmcounter15h -hpmcounter16h -hpmcounter17h -hpmcounter18h -hpmcounter19h -hpmcounter20h -hpmcounter21h -hpmcounter22h -hpmcounter23h -hpmcounter24h -hpmcounter25h -hpmcounter26h -hpmcounter27h -hpmcounter28h -hpmcounter29h -hpmcounter30h -mstatus -misa -mie -mtvec -mcounteren -mscratch -mepc -mcause -mtval -mip -pmpcfg0 -pmpaddr0 -pmpaddr1 -pmpaddr2 -pmpaddr3 -pmpaddr4 -pmpaddr5 -pmpaddr6 -pmpaddr7 -pmpaddr8 -pmpaddr9 -pmpaddr10 -pmpaddr11 -pmpaddr12 -pmpaddr13 -pmpaddr14 -pmpaddr15 -mhpmevent3 -mhpmevent4 -mhpmevent5 -mhpmevent6 -mhpmevent7 -mhpmevent8 -mhpmevent9 -mhpmevent10 -mhpmevent11 -mhpmevent12 -mhpmevent13 -mhpmevent14 -mhpmevent15 -mhpmevent16 -mhpmevent17 -mhpmevent18 -mhpmevent19 -mhpmevent20 -mhpmevent21 -mhpmevent22 -mhpmevent23 -mhpmevent24 -mhpmevent25 -mhpmevent26 -mhpmevent27 -mhpmevent28 -mhpmevent29 -mhpmevent30 -mhpmevent31 -mvendorid -marchid -mimpid -mhartid -mcycle -minstret -mhpmcounter3 -mhpmcounter4 -mhpmcounter5 -mhpmcounter6 -mhpmcounter7 -mhpmcounter8 -mhpmcounter9 -mhpmcounter10 -mhpmcounter11 -mhpmcounter12 -mhpmcounter13 -mhpmcounter14 -mhpmcounter15 -mhpmcounter16 -mhpmcounter17 -mhpmcounter18 -mhpmcounter19 -mhpmcounter20 -mhpmcounter21 -mhpmcounter22 -mhpmcounter23 -mhpmcounter24 -mhpmcounter25 -mhpmcounter26 -mhpmcounter27 -mhpmcounter28 -mhpmcounter29 -mhpmcounter30 -mhpmcounter31 -mhpmcounter4h -mhpmcounter5h -mhpmcounter6h -mhpmcounter7h -mhpmcounter8h -mhpmcounter9h -mhpmcounter10h -mhpmcounter11h -mhpmcounter12h -mhpmcounter13h -mhpmcounter14h -mhpmcounter15h -mhpmcounter16h -mhpmcounter17h -mhpmcounter18h -mhpmcounter19h -mhpmcounter20h -mhpmcounter21h -mhpmcounter22h -mhpmcounter23h -mhpmcounter24h -mhpmcounter25h -mhpmcounter26h -mhpmcounter27h -mhpmcounter28h -mhpmcounter29h -mhpmcounter30h -tselect -tdata1 -tdata2 -tdata3 -dcsr -dpc -dscratch diff --git a/bsp/coreip-s76-rtl/metal-inline.h b/bsp/coreip-s76-rtl/metal-inline.h deleted file mode 100644 index 685c7f0..0000000 --- a/bsp/coreip-s76-rtl/metal-inline.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_S76_RTL__METAL_INLINE_H -#define COREIP_S76_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_memory_80000000 = { - ._base_address = 2147483648UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - - -#endif /* COREIP_S76_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s76-rtl/metal-platform.h b/bsp/coreip-s76-rtl/metal-platform.h deleted file mode 100644 index c5231a4..0000000 --- a/bsp/coreip-s76-rtl/metal-platform.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_S76_RTL__METAL_PLATFORM_H -#define COREIP_S76_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 128UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 128UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_S76_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-s76-rtl/metal.default.lds b/bsp/coreip-s76-rtl/metal.default.lds deleted file mode 100644 index 4ff130f..0000000 --- a/bsp/coreip-s76-rtl/metal.default.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s76-rtl/metal.h b/bsp/coreip-s76-rtl/metal.h deleted file mode 100644 index 0cae61d..0000000 --- a/bsp/coreip-s76-rtl/metal.h +++ /dev/null @@ -1,809 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_S76_RTL__METAL_H -#define MACROS_IF_COREIP_S76_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_S76_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_S76_RTL__METAL_H -#define MACROS_ELSE_COREIP_S76_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 1 - -#define __METAL_PLIC_SUBINTERRUPTS 128 - -#define METAL_MAX_PLIC_INTERRUPTS 1 - -#define __METAL_PLIC_NUM_PARENTS 1 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 0 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_memory_80000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 1 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_memory_80000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#endif /* MACROS_ELSE_COREIP_S76_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-s76-rtl/metal.ramrodata.lds b/bsp/coreip-s76-rtl/metal.ramrodata.lds deleted file mode 100644 index 84d650e..0000000 --- a/bsp/coreip-s76-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - *(.itim .itim.*) - } >ram AT>ram :ram - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s76-rtl/metal.scratchpad.lds b/bsp/coreip-s76-rtl/metal.scratchpad.lds deleted file mode 100644 index 4ff130f..0000000 --- a/bsp/coreip-s76-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 1); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.itim .itim.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :ram_init - - - .itim : - { - *(.itim .itim.*) - } >ram AT>ram :ram_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-s76-rtl/settings.mk b/bsp/coreip-s76-rtl/settings.mk deleted file mode 100644 index 67d6499..0000000 --- a/bsp/coreip-s76-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imafdc -RISCV_ABI=lp64d -RISCV_CMODEL=medany -RISCV_SERIES=sifive-7-series - -COREIP_MEM_WIDTH=64 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-u54-rtl/README.md b/bsp/coreip-u54-rtl/README.md deleted file mode 100644 index cd34149..0000000 --- a/bsp/coreip-u54-rtl/README.md +++ /dev/null @@ -1,17 +0,0 @@ -The SiFive U54 Standard Core is a single-core instantiation of the world’s first RISC-V application processor, capable of supporting full-featured operating systems such as Linux. - -The U54 is ideal for low-cost Linux applications such as IoT nodes and gateways, point-of-sale, and networking. - -This target features: - -- 1 RV64GC U54 Application Core -- 16KB L1 I-cache with ECC -- 16KB L1 D-cache with ECC -- 8 Region Physical Memory Protection -- 48 Local Interrupts per core -- Sv39 Virtual Memory support with 38 Physical Address bits -- Integrated 128KB L2 Cache with ECC -- Real-time capabilities -- CLINT for multi-core timer and software interrupts -- PLIC with support for up to 128 interrupts with 7 priority levels -- Debug with instruction trace diff --git a/bsp/coreip-u54-rtl/design.dts b/bsp/coreip-u54-rtl/design.dts deleted file mode 100644 index 154dc42..0000000 --- a/bsp/coreip-u54-rtl/design.dts +++ /dev/null @@ -1,130 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FU540G-dev", "fu540-dev", "sifive-dev"; - model = "SiFive,FU540G"; - L19: cpus { - #address-cells = <1>; - #size-cells = <0>; - L8: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <16384>; - d-tlb-sets = <1>; - d-tlb-size = <32>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <16384>; - i-tlb-sets = <1>; - i-tlb-size = <32>; - mmu-type = "riscv,sv39"; - next-level-cache = <&L16>; - reg = <0x0>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,itim = <&L6>; - status = "okay"; - timebase-frequency = <1000000>; - tlb-split; - L5: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L11: memory@80000000 { - device_type = "memory"; - reg = <0x0 0x80000000 0x0 0x20000000>; - }; - L18: soc { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FU540G-soc", "fu540-soc", "sifive-soc", "simple-bus"; - ranges; - L13: axi4-periph-port@20000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-periph-port", "sifive,axi4-port", "sifive,periph-port", "simple-bus"; - ranges = <0x0 0x20000000 0x0 0x20000000 0x0 0x20000000 0x1 0x0 0x1 0x0 0xf 0x0>; - }; - L12: axi4-sys-port@40000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-sys-port", "sifive,axi4-port", "sifive,sys-port", "simple-bus"; - ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000 0x10 0x0 0x10 0x0 0x30 0x0>; - }; - L7: bus-error-unit@1700000 { - compatible = "sifive,buserror0"; - interrupt-parent = <&L2>; - interrupts = <132>; - reg = <0x0 0x1700000 0x0 0x1000>; - reg-names = "control"; - }; - L16: cache-controller@2010000 { - cache-block-size = <64>; - cache-level = <2>; - cache-sets = <512>; - cache-size = <262144>; - cache-unified; - compatible = "sifive,ccache0", "cache"; - interrupt-parent = <&L2>; - interrupts = <128 129 130 131>; - next-level-cache = <&L0 &L11>; - reg = <0x0 0x2010000 0x0 0x1000 0x0 0x8000000 0x0 0x40000>; - reg-names = "control", "sideband"; - sifive,ecc-granularity = <8>; - sifive,mshr-count = <5>; - }; - L3: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L5 3 &L5 7>; - reg = <0x0 0x2000000 0x0 0x10000>; - reg-names = "control"; - }; - L4: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L5 65535>; - reg = <0x0 0x0 0x0 0x1000>; - reg-names = "control"; - }; - L1: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x0 0x3000 0x0 0x1000>; - }; - L10: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L2>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L2: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L5 11 &L5 9>; - reg = <0x0 0xc000000 0x0 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <132>; - }; - L6: itim@1800000 { - compatible = "sifive,itim0"; - reg = <0x0 0x1800000 0x0 0x4000>; - reg-names = "mem"; - }; - L0: rom@a000000 { - compatible = "ucbbar,cacheable-zero0"; - reg = <0x0 0xa000000 0x0 0x2000000>; - }; - L9: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x0 0x4000 0x0 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-u54-rtl/metal-inline.h b/bsp/coreip-u54-rtl/metal-inline.h deleted file mode 100644 index cadee24..0000000 --- a/bsp/coreip-u54-rtl/metal-inline.h +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_U54_RTL__METAL_INLINE_H -#define COREIP_U54_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_itim_1800000 = { - ._base_address = 25165824UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_memory_80000000 = { - ._base_address = 2147483648UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From cache_controller@2010000 */ -struct __metal_driver_sifive_fu540_c000_l2 __metal_dt_cache_controller_2010000 = { - .cache.vtable = &__metal_driver_vtable_sifive_fu540_c000_l2.cache, -}; - - -#endif /* COREIP_U54_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-u54-rtl/metal-platform.h b/bsp/coreip-u54-rtl/metal-platform.h deleted file mode 100644 index ceee67d..0000000 --- a/bsp/coreip-u54-rtl/metal-platform.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_U54_RTL__METAL_PLATFORM_H -#define COREIP_U54_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 133UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 133UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From cache_controller@2010000 */ -#define METAL_SIFIVE_FU540_C000_L2_2010000_BASE_ADDRESS 33619968UL -#define METAL_SIFIVE_FU540_C000_L2_0_BASE_ADDRESS 33619968UL -#define METAL_SIFIVE_FU540_C000_L2_2010000_SIZE 4096UL -#define METAL_SIFIVE_FU540_C000_L2_0_SIZE 4096UL - -#define METAL_SIFIVE_FU540_C000_L2 -#define METAL_SIFIVE_FU540_C000_L2_CONFIG 0UL -#define METAL_SIFIVE_FU540_C000_L2_WAYENABLE 8UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_U54_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-u54-rtl/metal.default.lds b/bsp/coreip-u54-rtl/metal.default.lds deleted file mode 100644 index 863fdde..0000000 --- a/bsp/coreip-u54-rtl/metal.default.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 - itim (wx!rai) : ORIGIN = 0x1800000, LENGTH = 0x4000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-u54-rtl/metal.h b/bsp/coreip-u54-rtl/metal.h deleted file mode 100644 index acb0586..0000000 --- a/bsp/coreip-u54-rtl/metal.h +++ /dev/null @@ -1,827 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_U54_RTL__METAL_H -#define MACROS_IF_COREIP_U54_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 2 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 133 - -#define __METAL_PLIC_NUM_PARENTS 2 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_U54_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_U54_RTL__METAL_H -#define MACROS_ELSE_COREIP_U54_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 2 - -#define METAL_MAX_CLINT_INTERRUPTS 2 - -#define __METAL_CLINT_NUM_PARENTS 2 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 2 - -#define __METAL_PLIC_SUBINTERRUPTS 133 - -#define METAL_MAX_PLIC_INTERRUPTS 2 - -#define __METAL_PLIC_NUM_PARENTS 2 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 0 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_itim_1800000; - -struct metal_memory __metal_dt_mem_memory_80000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From cache_controller@2010000 */ -struct __metal_driver_sifive_fu540_c000_l2 __metal_dt_cache_controller_2010000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else if (idx == 1) { - return 9; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 2 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_itim_1800000, - &__metal_dt_mem_memory_80000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 1 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -/* From cache_controller@2010000 */ -#define __METAL_DT_SIFIVE_FU540_C000_L2_HANDLE (&__metal_dt_cache_controller_2010000) - -#define __METAL_DT_CACHE_CONTROLLER_2010000_HANDLE (&__metal_dt_cache_controller_2010000) - -#endif /* MACROS_ELSE_COREIP_U54_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-u54-rtl/metal.ramrodata.lds b/bsp/coreip-u54-rtl/metal.ramrodata.lds deleted file mode 100644 index ba26b30..0000000 --- a/bsp/coreip-u54-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 - itim (wx!rai) : ORIGIN = 0x1800000, LENGTH = 0x4000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-u54-rtl/metal.scratchpad.lds b/bsp/coreip-u54-rtl/metal.scratchpad.lds deleted file mode 100644 index 863fdde..0000000 --- a/bsp/coreip-u54-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 - itim (wx!rai) : ORIGIN = 0x1800000, LENGTH = 0x4000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-u54-rtl/settings.mk b/bsp/coreip-u54-rtl/settings.mk deleted file mode 100644 index 78a1ecb..0000000 --- a/bsp/coreip-u54-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imafdc -RISCV_ABI=lp64d -RISCV_CMODEL=medany -RISCV_SERIES=sifive-5-series - -COREIP_MEM_WIDTH=128 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 diff --git a/bsp/coreip-u54mc-rtl/README.md b/bsp/coreip-u54mc-rtl/README.md deleted file mode 100644 index 1d26288..0000000 --- a/bsp/coreip-u54mc-rtl/README.md +++ /dev/null @@ -1,23 +0,0 @@ -The SiFive U54-MC Standard Core is the world’s first RISC-V application processor, capable of supporting full-featured operating systems such as Linux. - -The U54-MC has 4x 64-bit U5 cores and 1x 64-bit S5 core—providing high performance with maximum efficiency. This core is an ideal choice for low-cost Linux applications such as IoT nodes and gateways, storage, and networking. - -This target features: - -- 4x RV64GC U54 Application Cores - - 32KB L1 I-cache with ECC - - 32KB L1 D-cache with ECC - - 8 Region Physical Memory Protection - - 48 Local Interrupts per core - - Sv39 Virtual Memory support with 38 Physical Address bits -- 1x RV64IMAC S51 Monitor Core - - 16KB L1 I-Cache with ECC - - 8KB DTIM with ECC - - 8 Region Physical Memory Protection - - 48 Local Interrupts -- Fully Coherent TileLink Bus -- Integrated 2MB L2 Cache with ECC -- Real-time capabilities -- CLINT for multi-core timer and software interrupts -- PLIC with support for up to 511 interrupts with 7 priority levels -- Debug with instruction trace diff --git a/bsp/coreip-u54mc-rtl/design.dts b/bsp/coreip-u54mc-rtl/design.dts deleted file mode 100644 index beba177..0000000 --- a/bsp/coreip-u54mc-rtl/design.dts +++ /dev/null @@ -1,291 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FU540G-dev", "fu540-dev", "sifive-dev"; - model = "SiFive,FU540G"; - L36: cpus { - #address-cells = <1>; - #size-cells = <0>; - L9: cpu@0 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <16384>; - next-level-cache = <&L33>; - reg = <0x0>; - riscv,isa = "rv64imac"; - riscv,pmpregions = <8>; - sifive,dtim = <&L7>; - sifive,itim = <&L6>; - status = "okay"; - timebase-frequency = <1000000>; - L5: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - L13: cpu@1 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <32>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <32>; - mmu-type = "riscv,sv39"; - next-level-cache = <&L33>; - reg = <0x1>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,itim = <&L11>; - status = "okay"; - timebase-frequency = <1000000>; - tlb-split; - L10: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - L17: cpu@2 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <32>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <32>; - mmu-type = "riscv,sv39"; - next-level-cache = <&L33>; - reg = <0x2>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,itim = <&L15>; - status = "okay"; - timebase-frequency = <1000000>; - tlb-split; - L14: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - L21: cpu@3 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <32>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <32>; - mmu-type = "riscv,sv39"; - next-level-cache = <&L33>; - reg = <0x3>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,itim = <&L19>; - status = "okay"; - timebase-frequency = <1000000>; - tlb-split; - L18: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - L25: cpu@4 { - clock-frequency = <0>; - compatible = "sifive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <32>; - device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <32>; - mmu-type = "riscv,sv39"; - next-level-cache = <&L33>; - reg = <0x4>; - riscv,isa = "rv64imafdc"; - riscv,pmpregions = <8>; - sifive,itim = <&L23>; - status = "okay"; - timebase-frequency = <1000000>; - tlb-split; - L22: interrupt-controller { - #interrupt-cells = <1>; - compatible = "riscv,cpu-intc"; - interrupt-controller; - }; - }; - }; - L28: memory@80000000 { - device_type = "memory"; - reg = <0x0 0x80000000 0x0 0x20000000>; - }; - L35: soc { - #address-cells = <2>; - #size-cells = <2>; - compatible = "SiFive,FU540G-soc", "fu540-soc", "sifive-soc", "simple-bus"; - ranges; - L30: axi4-periph-port@20000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-periph-port", "sifive,axi4-port", "sifive,periph-port", "simple-bus"; - ranges = <0x0 0x20000000 0x0 0x20000000 0x0 0x20000000 0x1 0x0 0x1 0x0 0xf 0x0>; - }; - L29: axi4-sys-port@40000000 { - #address-cells = <2>; - #size-cells = <2>; - compatible = "sifive,axi4-sys-port", "sifive,axi4-port", "sifive,sys-port", "simple-bus"; - ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000 0x10 0x0 0x10 0x0 0x30 0x0>; - }; - L8: bus-error-unit@1700000 { - compatible = "sifive,buserror0"; - interrupt-parent = <&L2>; - interrupts = <132>; - reg = <0x0 0x1700000 0x0 0x1000>; - reg-names = "control"; - }; - L12: bus-error-unit@1701000 { - compatible = "sifive,buserror0"; - interrupt-parent = <&L2>; - interrupts = <133>; - reg = <0x0 0x1701000 0x0 0x1000>; - reg-names = "control"; - }; - L16: bus-error-unit@1702000 { - compatible = "sifive,buserror0"; - interrupt-parent = <&L2>; - interrupts = <134>; - reg = <0x0 0x1702000 0x0 0x1000>; - reg-names = "control"; - }; - L20: bus-error-unit@1703000 { - compatible = "sifive,buserror0"; - interrupt-parent = <&L2>; - interrupts = <135>; - reg = <0x0 0x1703000 0x0 0x1000>; - reg-names = "control"; - }; - L24: bus-error-unit@1704000 { - compatible = "sifive,buserror0"; - interrupt-parent = <&L2>; - interrupts = <136>; - reg = <0x0 0x1704000 0x0 0x1000>; - reg-names = "control"; - }; - L33: cache-controller@2010000 { - cache-block-size = <64>; - cache-level = <2>; - cache-sets = <2048>; - cache-size = <2097152>; - cache-unified; - compatible = "sifive,ccache0", "cache"; - interrupt-parent = <&L2>; - interrupts = <128 129 130 131>; - next-level-cache = <&L0 &L28>; - reg = <0x0 0x2010000 0x0 0x1000 0x0 0x8000000 0x0 0x200000>; - reg-names = "control", "sideband"; - sifive,ecc-granularity = <8>; - sifive,mshr-count = <6>; - }; - L3: clint@2000000 { - compatible = "riscv,clint0"; - interrupts-extended = <&L5 3 &L5 7 &L10 3 &L10 7 &L14 3 &L14 7 &L18 3 &L18 7 &L22 3 &L22 7>; - reg = <0x0 0x2000000 0x0 0x10000>; - reg-names = "control"; - }; - L4: debug-controller@0 { - compatible = "sifive,debug-013", "riscv,debug-013"; - interrupts-extended = <&L5 65535 &L10 65535 &L14 65535 &L18 65535 &L22 65535>; - reg = <0x0 0x0 0x0 0x1000>; - reg-names = "control"; - }; - L7: dtim@1000000 { - compatible = "sifive,dtim0"; - reg = <0x0 0x1000000 0x0 0x2000>; - reg-names = "mem"; - }; - L1: error-device@3000 { - compatible = "sifive,error0"; - reg = <0x0 0x3000 0x0 0x1000>; - }; - L27: global-external-interrupts { - compatible = "sifive,global-external-interrupts0"; - interrupt-parent = <&L2>; - interrupts = <1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127>; - }; - L2: interrupt-controller@c000000 { - #interrupt-cells = <1>; - compatible = "riscv,plic0"; - interrupt-controller; - interrupts-extended = <&L5 11 &L10 11 &L10 9 &L14 11 &L14 9 &L18 11 &L18 9 &L22 11 &L22 9>; - reg = <0x0 0xc000000 0x0 0x4000000>; - reg-names = "control"; - riscv,max-priority = <7>; - riscv,ndev = <136>; - }; - L6: itim@1800000 { - compatible = "sifive,itim0"; - reg = <0x0 0x1800000 0x0 0x4000>; - reg-names = "mem"; - }; - L11: itim@1808000 { - compatible = "sifive,itim0"; - reg = <0x0 0x1808000 0x0 0x8000>; - reg-names = "mem"; - }; - L15: itim@1810000 { - compatible = "sifive,itim0"; - reg = <0x0 0x1810000 0x0 0x8000>; - reg-names = "mem"; - }; - L19: itim@1818000 { - compatible = "sifive,itim0"; - reg = <0x0 0x1818000 0x0 0x8000>; - reg-names = "mem"; - }; - L23: itim@1820000 { - compatible = "sifive,itim0"; - reg = <0x0 0x1820000 0x0 0x8000>; - reg-names = "mem"; - }; - L0: rom@a000000 { - compatible = "ucbbar,cacheable-zero0"; - reg = <0x0 0xa000000 0x0 0x2000000>; - }; - L26: teststatus@4000 { - compatible = "sifive,test0"; - reg = <0x0 0x4000 0x0 0x1000>; - reg-names = "control"; - }; - }; -}; diff --git a/bsp/coreip-u54mc-rtl/metal-inline.h b/bsp/coreip-u54mc-rtl/metal-inline.h deleted file mode 100644 index 3a5004d..0000000 --- a/bsp/coreip-u54mc-rtl/metal-inline.h +++ /dev/null @@ -1,257 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#ifndef COREIP_U54MC_RTL__METAL_INLINE_H -#define COREIP_U54MC_RTL__METAL_INLINE_H - -#include - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -extern inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- cpu ------------ */ -extern inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu); -extern inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu); -extern inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu); - - -/* --------------------- sifive_plic0 ------------ */ -extern inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller); -extern inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); -extern inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); -extern inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -extern inline int __metal_driver_sifive_global_external_interrupts0_init_done( ); -extern inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller); -extern inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx); - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -extern inline unsigned long __metal_driver_sifive_test0_base( ); -extern inline unsigned long __metal_driver_sifive_test0_size( ); - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -struct metal_memory __metal_dt_mem_dtim_1000000 = { - ._base_address = 16777216UL, - ._size = 8192UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_1800000 = { - ._base_address = 25165824UL, - ._size = 16384UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_1808000 = { - ._base_address = 25198592UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_1810000 = { - ._base_address = 25231360UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_1818000 = { - ._base_address = 25264128UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_itim_1820000 = { - ._base_address = 25296896UL, - ._size = 32768UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -struct metal_memory __metal_dt_mem_memory_80000000 = { - ._base_address = 2147483648UL, - ._size = 536870912UL, - ._attrs = { - .R = 1, - .W = 1, - .X = 1, - .C = 1, - .A = 1}, -}; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_clint0.clint_vtable, - .init_done = 0, -}; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From cpu@1 */ -struct __metal_driver_cpu __metal_dt_cpu_1 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From cpu@2 */ -struct __metal_driver_cpu __metal_dt_cpu_2 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From cpu@3 */ -struct __metal_driver_cpu __metal_dt_cpu_3 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From cpu@4 */ -struct __metal_driver_cpu __metal_dt_cpu_4 = { - .cpu.vtable = &__metal_driver_vtable_cpu.cpu_vtable, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_1_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_2_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_3_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller */ -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_4_interrupt_controller = { - .controller.vtable = &__metal_driver_vtable_riscv_cpu_intc.controller_vtable, - .init_done = 0, -}; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000 = { - .controller.vtable = &__metal_driver_vtable_riscv_plic0.plic_vtable, - .init_done = 0, -}; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts = { - .irc.vtable = &__metal_driver_vtable_sifive_global_external_interrupts0.global0_vtable, - .init_done = 0, -}; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000 = { - .shutdown.vtable = &__metal_driver_vtable_sifive_test0.shutdown, -}; - -/* From cache_controller@2010000 */ -struct __metal_driver_sifive_fu540_c000_l2 __metal_dt_cache_controller_2010000 = { - .cache.vtable = &__metal_driver_vtable_sifive_fu540_c000_l2.cache, -}; - - -#endif /* COREIP_U54MC_RTL__METAL_INLINE_H*/ -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-u54mc-rtl/metal-platform.h b/bsp/coreip-u54mc-rtl/metal-platform.h deleted file mode 100644 index 2c46b21..0000000 --- a/bsp/coreip-u54mc-rtl/metal-platform.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef COREIP_U54MC_RTL__METAL_PLATFORM_H -#define COREIP_U54MC_RTL__METAL_PLATFORM_H - -/* From clint@2000000 */ -#define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL -#define METAL_RISCV_CLINT0_2000000_SIZE 65536UL -#define METAL_RISCV_CLINT0_0_SIZE 65536UL - -#define METAL_RISCV_CLINT0 -#define METAL_RISCV_CLINT0_MSIP_BASE 0UL -#define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL -#define METAL_RISCV_CLINT0_MTIME 49144UL - -/* From interrupt_controller@c000000 */ -#define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL -#define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL -#define METAL_RISCV_PLIC0_0_SIZE 67108864UL -#define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL -#define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 137UL -#define METAL_RISCV_PLIC0_0_RISCV_NDEV 137UL - -#define METAL_RISCV_PLIC0 -#define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL -#define METAL_RISCV_PLIC0_PENDING_BASE 4096UL -#define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL - -/* From cache_controller@2010000 */ -#define METAL_SIFIVE_FU540_C000_L2_2010000_BASE_ADDRESS 33619968UL -#define METAL_SIFIVE_FU540_C000_L2_0_BASE_ADDRESS 33619968UL -#define METAL_SIFIVE_FU540_C000_L2_2010000_SIZE 4096UL -#define METAL_SIFIVE_FU540_C000_L2_0_SIZE 4096UL - -#define METAL_SIFIVE_FU540_C000_L2 -#define METAL_SIFIVE_FU540_C000_L2_CONFIG 0UL -#define METAL_SIFIVE_FU540_C000_L2_WAYENABLE 8UL - -/* From global_external_interrupts */ - -#define METAL_SIFIVE_GLOBAL_EXTERNAL_INTERRUPTS0 - -/* From teststatus@4000 */ -#define METAL_SIFIVE_TEST0_4000_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_0_BASE_ADDRESS 16384UL -#define METAL_SIFIVE_TEST0_4000_SIZE 4096UL -#define METAL_SIFIVE_TEST0_0_SIZE 4096UL - -#define METAL_SIFIVE_TEST0 -#define METAL_SIFIVE_TEST0_FINISHER_OFFSET 0UL - -#endif /* COREIP_U54MC_RTL__METAL_PLATFORM_H*/ diff --git a/bsp/coreip-u54mc-rtl/metal.default.lds b/bsp/coreip-u54mc-rtl/metal.default.lds deleted file mode 100644 index 3b03685..0000000 --- a/bsp/coreip-u54mc-rtl/metal.default.lds +++ /dev/null @@ -1,237 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 - itim (wx!rai) : ORIGIN = 0x1800000, LENGTH = 0x4000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - . = __stack_size; - . = __stack_size; - . = __stack_size; - . = __stack_size; - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-u54mc-rtl/metal.h b/bsp/coreip-u54mc-rtl/metal.h deleted file mode 100644 index 23b900c..0000000 --- a/bsp/coreip-u54mc-rtl/metal.h +++ /dev/null @@ -1,1004 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -#ifndef ASSEMBLY - -#include - -#ifdef __METAL_MACHINE_MACROS - -#ifndef MACROS_IF_COREIP_U54MC_RTL__METAL_H -#define MACROS_IF_COREIP_U54MC_RTL__METAL_H - -#define __METAL_CLINT_NUM_PARENTS 10 - -#ifndef __METAL_CLINT_NUM_PARENTS -#define __METAL_CLINT_NUM_PARENTS 0 -#endif -#define __METAL_PLIC_SUBINTERRUPTS 137 - -#define __METAL_PLIC_NUM_PARENTS 9 - -#ifndef __METAL_PLIC_SUBINTERRUPTS -#define __METAL_PLIC_SUBINTERRUPTS 0 -#endif -#ifndef __METAL_PLIC_NUM_PARENTS -#define __METAL_PLIC_NUM_PARENTS 0 -#endif -#ifndef __METAL_CLIC_SUBINTERRUPTS -#define __METAL_CLIC_SUBINTERRUPTS 0 -#endif - -#endif /* MACROS_IF_COREIP_U54MC_RTL__METAL_H*/ - -#else /* ! __METAL_MACHINE_MACROS */ - -#ifndef MACROS_ELSE_COREIP_U54MC_RTL__METAL_H -#define MACROS_ELSE_COREIP_U54MC_RTL__METAL_H - -#define __METAL_CLINT_2000000_INTERRUPTS 10 - -#define METAL_MAX_CLINT_INTERRUPTS 10 - -#define __METAL_CLINT_NUM_PARENTS 10 - -#define __METAL_INTERRUPT_CONTROLLER_C000000_INTERRUPTS 9 - -#define __METAL_PLIC_SUBINTERRUPTS 137 - -#define METAL_MAX_PLIC_INTERRUPTS 9 - -#define __METAL_PLIC_NUM_PARENTS 9 - -#define __METAL_CLIC_SUBINTERRUPTS 0 -#define METAL_MAX_CLIC_INTERRUPTS 0 - -#define METAL_MAX_LOCAL_EXT_INTERRUPTS 0 - -#define __METAL_GLOBAL_EXTERNAL_INTERRUPTS_INTERRUPTS 127 - -#define METAL_MAX_GLOBAL_EXT_INTERRUPTS 127 - -#define METAL_MAX_GPIO_INTERRUPTS 0 - -#define METAL_MAX_UART_INTERRUPTS 0 - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct metal_memory __metal_dt_mem_dtim_1000000; - -struct metal_memory __metal_dt_mem_itim_1800000; - -struct metal_memory __metal_dt_mem_itim_1808000; - -struct metal_memory __metal_dt_mem_itim_1810000; - -struct metal_memory __metal_dt_mem_itim_1818000; - -struct metal_memory __metal_dt_mem_itim_1820000; - -struct metal_memory __metal_dt_mem_memory_80000000; - -/* From clint@2000000 */ -struct __metal_driver_riscv_clint0 __metal_dt_clint_2000000; - -/* From cpu@0 */ -struct __metal_driver_cpu __metal_dt_cpu_0; - -/* From cpu@1 */ -struct __metal_driver_cpu __metal_dt_cpu_1; - -/* From cpu@2 */ -struct __metal_driver_cpu __metal_dt_cpu_2; - -/* From cpu@3 */ -struct __metal_driver_cpu __metal_dt_cpu_3; - -/* From cpu@4 */ -struct __metal_driver_cpu __metal_dt_cpu_4; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_0_interrupt_controller; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_1_interrupt_controller; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_2_interrupt_controller; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_3_interrupt_controller; - -struct __metal_driver_riscv_cpu_intc __metal_dt_cpu_4_interrupt_controller; - -/* From interrupt_controller@c000000 */ -struct __metal_driver_riscv_plic0 __metal_dt_interrupt_controller_c000000; - -struct metal_pmp __metal_dt_pmp; - -/* From global_external_interrupts */ -struct __metal_driver_sifive_global_external_interrupts0 __metal_dt_global_external_interrupts; - -/* From teststatus@4000 */ -struct __metal_driver_sifive_test0 __metal_dt_teststatus_4000; - -/* From cache_controller@2010000 */ -struct __metal_driver_sifive_fu540_c000_l2 __metal_dt_cache_controller_2010000; - - - -/* --------------------- fixed_clock ------------ */ - - -/* --------------------- fixed_factor_clock ------------ */ - - -/* --------------------- sifive_clint0 ------------ */ -static inline unsigned long __metal_driver_sifive_clint0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_clint0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_RISCV_CLINT0_2000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_clint0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_clint_2000000) { - return METAL_MAX_CLINT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_clint0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 2) { - return (struct metal_interrupt *)&__metal_dt_cpu_1_interrupt_controller.controller; - } - else if (idx == 3) { - return (struct metal_interrupt *)&__metal_dt_cpu_1_interrupt_controller.controller; - } - else if (idx == 4) { - return (struct metal_interrupt *)&__metal_dt_cpu_2_interrupt_controller.controller; - } - else if (idx == 5) { - return (struct metal_interrupt *)&__metal_dt_cpu_2_interrupt_controller.controller; - } - else if (idx == 6) { - return (struct metal_interrupt *)&__metal_dt_cpu_3_interrupt_controller.controller; - } - else if (idx == 7) { - return (struct metal_interrupt *)&__metal_dt_cpu_3_interrupt_controller.controller; - } - else if (idx == 8) { - return (struct metal_interrupt *)&__metal_dt_cpu_4_interrupt_controller.controller; - } - else if (idx == 9) { - return (struct metal_interrupt *)&__metal_dt_cpu_4_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_clint0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 3; - } - else if (idx == 1) { - return 7; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 7; - } - else if (idx == 4) { - return 3; - } - else if (idx == 5) { - return 7; - } - else if (idx == 6) { - return 3; - } - else if (idx == 7) { - return 7; - } - else if (idx == 8) { - return 3; - } - else if (idx == 9) { - return 7; - } - else { - return 0; - } -} - - - -/* --------------------- cpu ------------ */ -static inline int __metal_driver_cpu_hartid(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 0; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_1) { - return 1; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_2) { - return 2; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_3) { - return 3; - } - else { - return -1; - } -} - -static inline int __metal_driver_cpu_timebase(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 1000000; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_1) { - return 1000000; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_2) { - return 1000000; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_3) { - return 1000000; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_cpu_interrupt_controller(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return &__metal_dt_cpu_0_interrupt_controller.controller; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_1) { - return &__metal_dt_cpu_1_interrupt_controller.controller; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_2) { - return &__metal_dt_cpu_2_interrupt_controller.controller; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_3) { - return &__metal_dt_cpu_3_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_cpu_num_pmp_regions(struct metal_cpu *cpu) -{ - if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_0) { - return 8; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_1) { - return 8; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_2) { - return 8; - } - else if ((uintptr_t)cpu == (uintptr_t)&__metal_dt_cpu_3) { - return 8; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_plic0 ------------ */ -static inline unsigned long __metal_driver_sifive_plic0_control_base(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_BASE_ADDRESS; - } - else { - return 0; - } -} - -static inline unsigned long __metal_driver_sifive_plic0_control_size(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_SIZE; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_NDEV; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_interrupt_controller_c000000) { - return METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY; - } - else { - return 0; - } -} - -static inline struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 0) { - return (struct metal_interrupt *)&__metal_dt_cpu_0_interrupt_controller.controller; - } - else if (idx == 1) { - return (struct metal_interrupt *)&__metal_dt_cpu_1_interrupt_controller.controller; - } - else if (idx == 2) { - return (struct metal_interrupt *)&__metal_dt_cpu_1_interrupt_controller.controller; - } - else if (idx == 3) { - return (struct metal_interrupt *)&__metal_dt_cpu_2_interrupt_controller.controller; - } - else if (idx == 4) { - return (struct metal_interrupt *)&__metal_dt_cpu_2_interrupt_controller.controller; - } - else if (idx == 5) { - return (struct metal_interrupt *)&__metal_dt_cpu_3_interrupt_controller.controller; - } - else if (idx == 6) { - return (struct metal_interrupt *)&__metal_dt_cpu_3_interrupt_controller.controller; - } - else if (idx == 7) { - return (struct metal_interrupt *)&__metal_dt_cpu_4_interrupt_controller.controller; - } - else if (idx == 8) { - return (struct metal_interrupt *)&__metal_dt_cpu_4_interrupt_controller.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 11; - } - else if (idx == 0) { - return 11; - } - else if (idx == 1) { - return 11; - } - else if (idx == 2) { - return 9; - } - else if (idx == 3) { - return 11; - } - else if (idx == 4) { - return 9; - } - else if (idx == 5) { - return 11; - } - else if (idx == 6) { - return 9; - } - else if (idx == 7) { - return 11; - } - else if (idx == 8) { - return 9; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_clic0 ------------ */ - - -/* --------------------- sifive_local_external_interrupts0 ------------ */ - - -/* --------------------- sifive_global_external_interrupts0 ------------ */ -static inline int __metal_driver_sifive_global_external_interrupts0_init_done() -{ - return 0; -} - -static inline struct metal_interrupt * __metal_driver_sifive_global_external_interrupts0_interrupt_parent(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return (struct metal_interrupt *)&__metal_dt_interrupt_controller_c000000.controller; - } - else { - return NULL; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_num_interrupts(struct metal_interrupt *controller) -{ - if ((uintptr_t)controller == (uintptr_t)&__metal_dt_global_external_interrupts) { - return METAL_MAX_GLOBAL_EXT_INTERRUPTS; - } - else { - return 0; - } -} - -static inline int __metal_driver_sifive_global_external_interrupts0_interrupt_lines(struct metal_interrupt *controller, int idx) -{ - if (idx == 0) { - return 1; - } - else if (idx == 1) { - return 2; - } - else if (idx == 2) { - return 3; - } - else if (idx == 3) { - return 4; - } - else if (idx == 4) { - return 5; - } - else if (idx == 5) { - return 6; - } - else if (idx == 6) { - return 7; - } - else if (idx == 7) { - return 8; - } - else if (idx == 8) { - return 9; - } - else if (idx == 9) { - return 10; - } - else if (idx == 10) { - return 11; - } - else if (idx == 11) { - return 12; - } - else if (idx == 12) { - return 13; - } - else if (idx == 13) { - return 14; - } - else if (idx == 14) { - return 15; - } - else if (idx == 15) { - return 16; - } - else if (idx == 16) { - return 17; - } - else if (idx == 17) { - return 18; - } - else if (idx == 18) { - return 19; - } - else if (idx == 19) { - return 20; - } - else if (idx == 20) { - return 21; - } - else if (idx == 21) { - return 22; - } - else if (idx == 22) { - return 23; - } - else if (idx == 23) { - return 24; - } - else if (idx == 24) { - return 25; - } - else if (idx == 25) { - return 26; - } - else if (idx == 26) { - return 27; - } - else if (idx == 27) { - return 28; - } - else if (idx == 28) { - return 29; - } - else if (idx == 29) { - return 30; - } - else if (idx == 30) { - return 31; - } - else if (idx == 31) { - return 32; - } - else if (idx == 32) { - return 33; - } - else if (idx == 33) { - return 34; - } - else if (idx == 34) { - return 35; - } - else if (idx == 35) { - return 36; - } - else if (idx == 36) { - return 37; - } - else if (idx == 37) { - return 38; - } - else if (idx == 38) { - return 39; - } - else if (idx == 39) { - return 40; - } - else if (idx == 40) { - return 41; - } - else if (idx == 41) { - return 42; - } - else if (idx == 42) { - return 43; - } - else if (idx == 43) { - return 44; - } - else if (idx == 44) { - return 45; - } - else if (idx == 45) { - return 46; - } - else if (idx == 46) { - return 47; - } - else if (idx == 47) { - return 48; - } - else if (idx == 48) { - return 49; - } - else if (idx == 49) { - return 50; - } - else if (idx == 50) { - return 51; - } - else if (idx == 51) { - return 52; - } - else if (idx == 52) { - return 53; - } - else if (idx == 53) { - return 54; - } - else if (idx == 54) { - return 55; - } - else if (idx == 55) { - return 56; - } - else if (idx == 56) { - return 57; - } - else if (idx == 57) { - return 58; - } - else if (idx == 58) { - return 59; - } - else if (idx == 59) { - return 60; - } - else if (idx == 60) { - return 61; - } - else if (idx == 61) { - return 62; - } - else if (idx == 62) { - return 63; - } - else if (idx == 63) { - return 64; - } - else if (idx == 64) { - return 65; - } - else if (idx == 65) { - return 66; - } - else if (idx == 66) { - return 67; - } - else if (idx == 67) { - return 68; - } - else if (idx == 68) { - return 69; - } - else if (idx == 69) { - return 70; - } - else if (idx == 70) { - return 71; - } - else if (idx == 71) { - return 72; - } - else if (idx == 72) { - return 73; - } - else if (idx == 73) { - return 74; - } - else if (idx == 74) { - return 75; - } - else if (idx == 75) { - return 76; - } - else if (idx == 76) { - return 77; - } - else if (idx == 77) { - return 78; - } - else if (idx == 78) { - return 79; - } - else if (idx == 79) { - return 80; - } - else if (idx == 80) { - return 81; - } - else if (idx == 81) { - return 82; - } - else if (idx == 82) { - return 83; - } - else if (idx == 83) { - return 84; - } - else if (idx == 84) { - return 85; - } - else if (idx == 85) { - return 86; - } - else if (idx == 86) { - return 87; - } - else if (idx == 87) { - return 88; - } - else if (idx == 88) { - return 89; - } - else if (idx == 89) { - return 90; - } - else if (idx == 90) { - return 91; - } - else if (idx == 91) { - return 92; - } - else if (idx == 92) { - return 93; - } - else if (idx == 93) { - return 94; - } - else if (idx == 94) { - return 95; - } - else if (idx == 95) { - return 96; - } - else if (idx == 96) { - return 97; - } - else if (idx == 97) { - return 98; - } - else if (idx == 98) { - return 99; - } - else if (idx == 99) { - return 100; - } - else if (idx == 100) { - return 101; - } - else if (idx == 101) { - return 102; - } - else if (idx == 102) { - return 103; - } - else if (idx == 103) { - return 104; - } - else if (idx == 104) { - return 105; - } - else if (idx == 105) { - return 106; - } - else if (idx == 106) { - return 107; - } - else if (idx == 107) { - return 108; - } - else if (idx == 108) { - return 109; - } - else if (idx == 109) { - return 110; - } - else if (idx == 110) { - return 111; - } - else if (idx == 111) { - return 112; - } - else if (idx == 112) { - return 113; - } - else if (idx == 113) { - return 114; - } - else if (idx == 114) { - return 115; - } - else if (idx == 115) { - return 116; - } - else if (idx == 116) { - return 117; - } - else if (idx == 117) { - return 118; - } - else if (idx == 118) { - return 119; - } - else if (idx == 119) { - return 120; - } - else if (idx == 120) { - return 121; - } - else if (idx == 121) { - return 122; - } - else if (idx == 122) { - return 123; - } - else if (idx == 123) { - return 124; - } - else if (idx == 124) { - return 125; - } - else if (idx == 125) { - return 126; - } - else if (idx == 126) { - return 127; - } - else { - return 0; - } -} - - - -/* --------------------- sifive_gpio0 ------------ */ - - -/* --------------------- sifive_gpio_button ------------ */ - - -/* --------------------- sifive_gpio_led ------------ */ - - -/* --------------------- sifive_gpio_switch ------------ */ - - -/* --------------------- sifive_spi0 ------------ */ - - -/* --------------------- sifive_test0 ------------ */ -static inline unsigned long __metal_driver_sifive_test0_base( ) -{ - return 16384; -} - -static inline unsigned long __metal_driver_sifive_test0_size( ) -{ - return 4096; -} - - - -/* --------------------- sifive_uart0 ------------ */ - - -/* --------------------- sifive_fe310_g000_hfrosc ------------ */ - - -/* --------------------- sifive_fe310_g000_hfxosc ------------ */ - - -/* --------------------- sifive_fe310_g000_pll ------------ */ - - -/* --------------------- sifive_fe310_g000_prci ------------ */ - - -/* --------------------- sifive_fu540_c000_l2 ------------ */ - - -#define __METAL_DT_MAX_MEMORIES 7 - -asm (".weak __metal_memory_table"); -struct metal_memory *__metal_memory_table[] = { - &__metal_dt_mem_dtim_1000000, - &__metal_dt_mem_itim_1800000, - &__metal_dt_mem_itim_1808000, - &__metal_dt_mem_itim_1810000, - &__metal_dt_mem_itim_1818000, - &__metal_dt_mem_itim_1820000, - &__metal_dt_mem_memory_80000000}; - -/* From clint@2000000 */ -#define __METAL_DT_RISCV_CLINT0_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_CLINT_2000000_HANDLE (&__metal_dt_clint_2000000.controller) - -#define __METAL_DT_MAX_HARTS 5 - -asm (".weak __metal_cpu_table"); -struct __metal_driver_cpu *__metal_cpu_table[] = { - &__metal_dt_cpu_0, - &__metal_dt_cpu_1, - &__metal_dt_cpu_2, - &__metal_dt_cpu_3, - &__metal_dt_cpu_4}; - -/* From interrupt_controller@c000000 */ -#define __METAL_DT_RISCV_PLIC0_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_INTERRUPT_CONTROLLER_C000000_HANDLE (&__metal_dt_interrupt_controller_c000000.controller) - -#define __METAL_DT_PMP_HANDLE (&__metal_dt_pmp) - -/* From global_external_interrupts */ -#define __METAL_DT_SIFIVE_GLOBAL_EXINTR0_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __METAL_DT_GLOBAL_EXTERNAL_INTERRUPTS_HANDLE (&__metal_dt_global_external_interrupts.irc) - -#define __MEE_DT_MAX_GPIOS 0 - -asm (".weak __metal_gpio_table"); -struct __metal_driver_sifive_gpio0 *__metal_gpio_table[] = { - NULL }; -#define __METAL_DT_MAX_BUTTONS 0 - -asm (".weak __metal_button_table"); -struct __metal_driver_sifive_gpio_button *__metal_button_table[] = { - NULL }; -#define __METAL_DT_MAX_LEDS 0 - -asm (".weak __metal_led_table"); -struct __metal_driver_sifive_gpio_led *__metal_led_table[] = { - NULL }; -#define __METAL_DT_MAX_SWITCHES 0 - -asm (".weak __metal_switch_table"); -struct __metal_driver_sifive_gpio_switch *__metal_switch_table[] = { - NULL }; -#define __METAL_DT_MAX_SPIS 0 - -asm (".weak __metal_spi_table"); -struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { - NULL }; -/* From teststatus@4000 */ -#define __METAL_DT_SHUTDOWN_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -#define __METAL_DT_TESTSTATUS_4000_HANDLE (&__metal_dt_teststatus_4000.shutdown) - -/* From cache_controller@2010000 */ -#define __METAL_DT_SIFIVE_FU540_C000_L2_HANDLE (&__metal_dt_cache_controller_2010000) - -#define __METAL_DT_CACHE_CONTROLLER_2010000_HANDLE (&__metal_dt_cache_controller_2010000) - -#endif /* MACROS_ELSE_COREIP_U54MC_RTL__METAL_H*/ - -#endif /* ! __METAL_MACHINE_MACROS */ - -#endif /* ! ASSEMBLY */ diff --git a/bsp/coreip-u54mc-rtl/metal.ramrodata.lds b/bsp/coreip-u54mc-rtl/metal.ramrodata.lds deleted file mode 100644 index 88d7a5e..0000000 --- a/bsp/coreip-u54mc-rtl/metal.ramrodata.lds +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 - itim (wx!rai) : ORIGIN = 0x1800000, LENGTH = 0x4000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - . = __stack_size; - . = __stack_size; - . = __stack_size; - . = __stack_size; - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-u54mc-rtl/metal.scratchpad.lds b/bsp/coreip-u54mc-rtl/metal.scratchpad.lds deleted file mode 100644 index 3b03685..0000000 --- a/bsp/coreip-u54mc-rtl/metal.scratchpad.lds +++ /dev/null @@ -1,237 +0,0 @@ -/* Copyright 2019 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ -/* ----------------------------------- */ -/* ----------------------------------- */ - -OUTPUT_ARCH("riscv") - -ENTRY(_enter) - -MEMORY -{ - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x20000000 - itim (wx!rai) : ORIGIN = 0x1800000, LENGTH = 0x4000 -} - -PHDRS -{ - flash PT_LOAD; - ram_init PT_LOAD; - itim_init PT_LOAD; - ram PT_LOAD; - itim PT_LOAD; -} - -SECTIONS -{ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; - PROVIDE(__metal_boot_hart = 0); - PROVIDE(__metal_chicken_bit = 0); - - - .init : - { - KEEP (*(.text.metal.init.enter)) - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.libgloss.start)) - } >ram AT>ram :ram - - - .text : - { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram AT>ram :ram - - - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram AT>ram :ram - - - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - - .rodata : - { - *(.rdata) - *(.rodata .rodata.*) - *(.gnu.linkonce.r.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - } >ram AT>ram :ram - - - . = ALIGN(4); - - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>ram :ram - - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>ram :ram - - - .finit_array : - { - PROVIDE_HIDDEN (__finit_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__finit_array_end = .); - } >ram AT>ram :ram - - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram AT>ram :ram - - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram AT>ram :ram - - - .litimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - - .ditimalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - - .itim : - { - *(.itim .itim.*) - } >itim AT>ram :itim_init - - - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_end = . ); - - - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - - - .dalign : - { - . = ALIGN(4); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - - .data : - { - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.* .sdata2.*) - *(.gnu.linkonce.s.*) - } >ram AT>ram :ram_init - - - . = ALIGN(4); - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - - - .bss : - { - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - } >ram AT>ram :ram - - - . = ALIGN(8); - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); - - - .stack : - { - PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; - PROVIDE( _sp = . ); - . = __stack_size; - . = __stack_size; - . = __stack_size; - . = __stack_size; - PROVIDE(metal_segment_stack_end = .); - } >ram AT>ram :ram - - - .heap : - { - PROVIDE( metal_segment_heap_target_start = . ); - . = __heap_size; - PROVIDE( metal_segment_heap_target_end = . ); - PROVIDE( _heap_end = . ); - } >ram AT>ram :ram - - -} - diff --git a/bsp/coreip-u54mc-rtl/settings.mk b/bsp/coreip-u54mc-rtl/settings.mk deleted file mode 100644 index cbd21b4..0000000 --- a/bsp/coreip-u54mc-rtl/settings.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 SiFive, Inc # -# SPDX-License-Identifier: Apache-2.0 # -# ----------------------------------- # -# ----------------------------------- # - -RISCV_ARCH=rv64imac -RISCV_ABI=lp64 -RISCV_CMODEL=medany -RISCV_SERIES=sifive-5-series - -COREIP_MEM_WIDTH=128 - -TARGET_TAGS=rtl -TARGET_DHRY_ITERS=2000 -TARGET_CORE_ITERS=5 -- cgit v1.2.3 From 713237cb963ebf81aca0715d8a770fdbe5d71cb9 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Wed, 19 Jun 2019 15:26:02 -0700 Subject: update-targets updates everything in the bsp folder Signed-off-by: Nathaniel Graff --- bsp/update-targets.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bsp') diff --git a/bsp/update-targets.sh b/bsp/update-targets.sh index 198cd5a..e080bb0 100755 --- a/bsp/update-targets.sh +++ b/bsp/update-targets.sh @@ -42,8 +42,7 @@ done if [ "$CUSTOM_PATH" == "" -a "$CUSTOM_NAME" == "" -a "$DTSFILE" == "" ] then - TARGET_LIST="$(ls -d coreip*) " - TARGET_LIST+="sifive-hifive1 sifive-hifive1-revb freedom-e310-arty sifive-hifive-unleashed " + TARGET_LIST="$(ls -d */) " else file "$DTSFILE" if [ ! -f "$DTSFILE" ] -- cgit v1.2.3