X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=bootrom%2Fsdboot%2Finclude%2Fdevices%2Fplic.h;fp=bootrom%2Fsdboot%2Finclude%2Fdevices%2Fplic.h;h=4d5b2d8dd255700355f5d35abb93362cc771c648;hb=ec70d85cbc03ce5b497b58d1b0f50f39a3e2a4e3;hp=0000000000000000000000000000000000000000;hpb=f4375c22662f82b1b4f94e88b1aba6998b1f34ba;p=freedom-sifive.git diff --git a/bootrom/sdboot/include/devices/plic.h b/bootrom/sdboot/include/devices/plic.h new file mode 100644 index 0000000..4d5b2d8 --- /dev/null +++ b/bootrom/sdboot/include/devices/plic.h @@ -0,0 +1,31 @@ +// See LICENSE for license details. + +#ifndef PLIC_H +#define PLIC_H + +#include + +// 32 bits per source +#define PLIC_PRIORITY_OFFSET _AC(0x0000,UL) +#define PLIC_PRIORITY_SHIFT_PER_SOURCE 2 +// 1 bit per source (1 address) +#define PLIC_PENDING_OFFSET _AC(0x1000,UL) +#define PLIC_PENDING_SHIFT_PER_SOURCE 0 + +//0x80 per target +#define PLIC_ENABLE_OFFSET _AC(0x2000,UL) +#define PLIC_ENABLE_SHIFT_PER_TARGET 7 + + +#define PLIC_THRESHOLD_OFFSET _AC(0x200000,UL) +#define PLIC_CLAIM_OFFSET _AC(0x200004,UL) +#define PLIC_THRESHOLD_SHIFT_PER_TARGET 12 +#define PLIC_CLAIM_SHIFT_PER_TARGET 12 + +#define PLIC_MAX_SOURCE 1023 +#define PLIC_SOURCE_MASK 0x3FF + +#define PLIC_MAX_TARGET 15871 +#define PLIC_TARGET_MASK 0x3FFF + +#endif /* PLIC_H */