allwinner-h3.c (3b35d4542c8537a9269f6372df531ced6c960084) allwinner-h3.c (a9262f551eba44d4d0f9e396d7124c059a93e204)
1/*
2 * Allwinner H3 System on Chip emulation
3 *
4 * Copyright (C) 2019 Niek Linnenbank <nieklinnenbank@gmail.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or

--- 160 unchanged lines hidden (view full) ---

169 AW_H3_GIC_NUM_SPI = 128
170};
171
172void allwinner_h3_bootrom_setup(AwH3State *s, BlockBackend *blk)
173{
174 const int64_t rom_size = 32 * KiB;
175 g_autofree uint8_t *buffer = g_new0(uint8_t, rom_size);
176
1/*
2 * Allwinner H3 System on Chip emulation
3 *
4 * Copyright (C) 2019 Niek Linnenbank <nieklinnenbank@gmail.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or

--- 160 unchanged lines hidden (view full) ---

169 AW_H3_GIC_NUM_SPI = 128
170};
171
172void allwinner_h3_bootrom_setup(AwH3State *s, BlockBackend *blk)
173{
174 const int64_t rom_size = 32 * KiB;
175 g_autofree uint8_t *buffer = g_new0(uint8_t, rom_size);
176
177 if (blk_pread(blk, 8 * KiB, buffer, rom_size, 0) < 0) {
177 if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) {
178 error_setg(&error_fatal, "%s: failed to read BlockBackend data",
179 __func__);
180 return;
181 }
182
183 rom_add_blob("allwinner-h3.bootrom", buffer, rom_size,
184 rom_size, s->memmap[AW_H3_DEV_SRAM_A1],
185 NULL, NULL, NULL, NULL, false);

--- 271 unchanged lines hidden ---
178 error_setg(&error_fatal, "%s: failed to read BlockBackend data",
179 __func__);
180 return;
181 }
182
183 rom_add_blob("allwinner-h3.bootrom", buffer, rom_size,
184 rom_size, s->memmap[AW_H3_DEV_SRAM_A1],
185 NULL, NULL, NULL, NULL, false);

--- 271 unchanged lines hidden ---