66// PICO_CONFIG: PICO_RAND_ENTROPY_SRC_ROSC, Enable/disable use of ROSC as an entropy source, type=bool, default=1 if no hardware TRNG, group=pico_rand
67#ifndef PICO_RAND_ENTROPY_SRC_ROSC
68#if !HAS_RP2350_TRNG
69#define PICO_RAND_ENTROPY_SRC_ROSC 1
70#endif
71#endif
72
73// PICO_CONFIG: PICO_RAND_ENTROPY_SRC_TRNG, Enable/disable use of hardware TRNG as an entropy source, type=bool, default=1 if hardware TRNG is available, group=pico_rand
74#ifndef PICO_RAND_ENTROPY_SRC_TRNG
75#if HAS_RP2350_TRNG
76#define PICO_RAND_ENTROPY_SRC_TRNG 1
77#endif
78#endif
79
80// PICO_CONFIG: PICO_RAND_ENTROPY_SRC_TIME, Enable/disable use of hardware timestamp as an entropy source, type=bool, default=1, group=pico_rand
81#ifndef PICO_RAND_ENTROPY_SRC_TIME
82#define PICO_RAND_ENTROPY_SRC_TIME 1
83#endif
84
85// PICO_CONFIG: PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER, Enable/disable use of a bus performance counter as an entropy source, type=bool, default=1 if no hardware TRNG, group=pico_rand
96// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_ROSC, Enable/disable use of ROSC as an entropy source for the random seed, type=bool, default=PICO_RAND_ENTROPY_SRC_ROSC, group=pico_rand
101// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_TRNG, Enable/disable use of hardware TRNG as an entropy source for the random seed, type=bool, default=PICO_RAND_ENTROPY_SRC_TRNG, group=pico_rand
106// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_TIME, Enable/disable use of hardware timestamp as an entropy source for the random seed, type=bool, default=PICO_RAND_ENTROPY_SRC_TIME, group=pico_rand
111// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_BUS_PERF_COUNTER, Enable/disable use of a bus performance counter as an entropy source for the random seed, type=bool, default=PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER, group=pico_rand
116// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_BOOT_RANDOM, Enable/disable use of the per boot random number as an entropy source for the random seed, type=bool, default=0 on RP2040 which has none, group=pico_rand
123// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_BOARD_ID, Enable/disable use of board id as part of the random seed, type=bool, default=not PICO_RAND_SEED_ENTROPY_SRC_BOOT_RANDOM, group=pico_rand
128// PICO_CONFIG: PICO_RAND_SEED_ENTROPY_SRC_RAM_HASH, Enable/disable use of a RAM hash as an entropy source for the random seed, type=bool, default=1 if no hardware TRNG, group=pico_rand
129#ifndef PICO_RAND_SEED_ENTROPY_SRC_RAM_HASH
130#if !HAS_RP2350_TRNG
131#define PICO_RAND_SEED_ENTROPY_SRC_RAM_HASH 1
132#endif
133#endif
134
135// ---------------------------------
136// PICO_RAND_ENTROPY_SRC_ROSC CONFIG
137// ---------------------------------
138
139// PICO_CONFIG: PICO_RAND_ROSC_BIT_SAMPLE_COUNT, Number of samples to take of the ROSC random bit per random number generation , min=1, max=64, default=1, group=pico_rand
140#ifndef PICO_RAND_ROSC_BIT_SAMPLE_COUNT
141#define PICO_RAND_ROSC_BIT_SAMPLE_COUNT 1
142#endif
143
144// PICO_CONFIG: PICO_RAND_MIN_ROSC_BIT_SAMPLE_TIME_US, Define a default minimum time between sampling the ROSC random bit, min=5, max=20, default=10, group=pico_rand
145#ifndef PICO_RAND_MIN_ROSC_BIT_SAMPLE_TIME_US
146// (Arbitrary / tested) minimum time between sampling the ROSC random bit
154// PICO_CONFIG: PICO_RAND_BUS_PERF_COUNTER_INDEX, Bus performance counter index to use for sourcing entropy, min=0, max=3, default=Undefined meaning pick one that is not counting any valid event already, group=pico_rand
155// this is deliberately undefined by default, meaning the code will pick that appears unused
156#if 0 // make tooling checks happy
157#define PICO_RAND_BUS_PERF_COUNTER_INDEX 0
158#endif
159
160// PICO_CONFIG: PICO_RAND_BUS_PERF_COUNTER_EVENT, Bus performance counter event to use for sourcing entropy, default=arbiter_sram5_perf_event_access, group=pico_rand
169// PICO_CONFIG: PICO_RAND_RAM_HASH_END, End of address in RAM (non-inclusive) to hash during pico_rand seed initialization, default=SRAM_END, group=pico_rand
170#ifndef PICO_RAND_RAM_HASH_END
171#define PICO_RAND_RAM_HASH_END SRAM_END
172#endif
173// PICO_CONFIG: PICO_RAND_RAM_HASH_START, Start of address in RAM (inclusive) to hash during pico_rand seed initialization, default=PICO_RAND_RAM_HASH_END - 1024, group=pico_rand