#include "elf64.h"
+static inline void mtspr(int sprnum, unsigned long val)
+{
+ __asm__ volatile("mtspr %0,%1" : : "i" (sprnum), "r" (val));
+}
+
static inline uint32_t read32(const void *addr)
{
return *(volatile uint32_t *)addr;
unsigned long faddr = copy_flash(spi_offs);
if (faddr != -1ul) {
// jump to absolute address
+ /* could do it this way but hey modify head.S instead
+ mtspr(8, faddr); // move address to LR
+ __asm__ volatile("blr");
+ */
+
+ // works with head.S which copies r3 into ctr then does bctr
return faddr;
}
}
self._decoder.add(self.bootmem.bus, addr=fw_addr) # ROM at fw_addr
# System Configuration info
- # offset executable ELF payload at 1 megabyte offset (1<<20)
- spi_offset = 1<<20 if (spi_0_pins is not None) else None
+ # offset executable ELF payload at 6 megabyte offset (6<<20)
+ spi_offset = 6<<20 if (spi_0_pins is not None) else None
dram_offset = ddr_addr if (ddr_pins is not None) else None
self.syscon = MicrowattSYSCON(sys_clk_freq=clk_freq,
has_uart=(uart_pins is not None),
if fpga == 'isim':
clk_freq = 55e6 # below 50 mhz, stops DRAM being enabled
if fpga == 'versa_ecp5':
- clk_freq = 45e6 # crank right down to test hyperram
+ clk_freq = 55e6 # crank right down to test hyperram
if fpga == 'versa_ecp5_85':
# 50MHz works. 100MHz works. 55MHz does NOT work.
# Stick with multiples of 50MHz...