Revision 57
Added by markw about 11 years ago
common/zpu/zpu_config_regs.vhdl | ||
---|---|---|
ENTITY zpu_config_regs IS
|
||
GENERIC
|
||
(
|
||
platform : integer := 1 -- So ROM can detect which type of system...
|
||
platform : integer := 1; -- So ROM can detect which type of system...
|
||
spi_clock_div : integer := 4 -- Quite conservative by default - probably want to use 1 with 28MHz input clock, 2 for 57MHz input clock, 4 for 114MHz input clock etc
|
||
);
|
||
PORT
|
||
(
|
||
... | ... | |
if (cpu_data_in(1) = '1') then
|
||
spi_speed_next <= X"80"; -- slow, for init
|
||
else
|
||
spi_speed_next <= X"04"; -- turbo!
|
||
spi_speed_next <= std_logic_vector(to_unsigned(spi_clock_div,8)); -- turbo - up to 25MHz for SD, 20MHz for MMC I believe... If 1 then clock is half input, if 2 then clock is 1/4 input etc.
|
||
end if;
|
||
end if;
|
||
|
common/zpu/zpucore.vhd | ||
---|---|---|
ENTITY zpucore IS
|
||
GENERIC
|
||
(
|
||
platform : integer := 1 -- So ROM can detect which type of system...
|
||
platform : integer := 1; -- So ROM can detect which type of system...
|
||
spi_clock_div : integer := 4 -- see notes on zpu_config_regs
|
||
);
|
||
PORT
|
||
(
|
||
... | ... | |
|
||
config_regs : entity work.zpu_config_regs
|
||
GENERIC MAP (
|
||
platform => platform
|
||
platform => platform,
|
||
spi_clock_div => spi_clock_div
|
||
)
|
||
PORT MAP (
|
||
CLK => CLK,
|
Also available in: Unified diff
Allow SPI clock speed to be set by generic. It was running at half speed for 28MHz platforms vs 58MHz platforms. Need to improve spi speed since byte wise writing is too slow loading roms - 8 seconds on startup!