more fiixzyyzs

This commit is contained in:
Polprzewodnikowy 2021-11-30 01:15:24 +01:00
parent f8ff05c79b
commit 42a8def063
3 changed files with 4 additions and 9 deletions

View File

@ -47,15 +47,13 @@ void sc64_set_config(cfg_id_t id, uint32_t value) {
}
void sc64_get_info(info_t *info) {
io32_t *src = UNCACHED(SC64_BL_VERSION_BASE);
io32_t *src = UNCACHED(&header_text_info);
uint32_t *dst = (uint32_t *) info->bootloader_version;
sc64_set_config(CFG_ID_SDRAM_SWITCH, false);
for (int i = 0; i < sizeof(info->bootloader_version); i += sizeof(uint32_t)) {
*dst++ = pi_io_read(src++);
}
sc64_set_config(CFG_ID_SDRAM_SWITCH, true);
info->dd_enabled = (bool) sc64_get_config(CFG_ID_DD_ENABLE);

View File

@ -18,11 +18,6 @@
#endif
extern char *header_text_info;
#define SC64_BL_VERSION_BASE (PHYSICAL((io32_t *) (header_text_info)))
typedef struct {
io32_t SR_CMD;
io32_t DATA[2];
@ -103,6 +98,9 @@ typedef struct {
} info_t;
extern char header_text_info;
bool sc64_check_presence(void);
void sc64_wait_cpu_ready(void);
bool sc64_wait_cpu_busy(void);

View File

@ -12,7 +12,6 @@ typedef volatile uint32_t io32_t;
#define ALIGN(value, align) (((value) + ((typeof(value))(align) - 1)) & ~((typeof(value))(align) - 1))
#define PHYSICAL(address) ((io32_t *) (((io32_t) (address)) & 0x1FFFFFFFUL))
#define CACHED(address) ((io32_t *) ((((io32_t) (address)) & 0x1FFFFFFFUL) | 0x80000000UL))
#define UNCACHED(address) ((io32_t *) ((((io32_t) (address)) & 0x1FFFFFFFUL) | 0xA0000000UL))