| 1 | /* |
| 2 | * MAX78000 True Random Number Generator |
| 3 | * |
| 4 | * Copyright (c) 2025 Jackson Donaldson <jcksn@duck.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | #ifndef HW_MAX78000_TRNG_H |
| 9 | #define HW_MAX78000_TRNG_H |
| 10 | |
| 11 | #include "hw/core/sysbus.h" |
| 12 | #include "qom/object.h" |
| 13 | |
| 14 | #define TYPE_MAX78000_TRNG "max78000-trng" |
| 15 | OBJECT_DECLARE_SIMPLE_TYPE(Max78000TrngState, MAX78000_TRNG) |
| 16 | |
| 17 | #define CTRL 0 |
| 18 | #define STATUS 4 |
| 19 | #define DATA 8 |
| 20 | |
| 21 | #define RND_IE (1 << 1) |
| 22 | |
| 23 | struct Max78000TrngState { |
| 24 | SysBusDevice parent_obj; |
| 25 | |
| 26 | MemoryRegion mmio; |
| 27 | |
| 28 | uint32_t ctrl; |
| 29 | uint32_t status; |
| 30 | uint32_t data; |
| 31 | |
| 32 | qemu_irq irq; |
| 33 | }; |
| 34 | |
| 35 | #endif |