32 lines
1.4 KiB
VHDL
32 lines
1.4 KiB
VHDL
-- -------------------------------------------------------------------------- --
|
|
-- flashrom_pkg.vhd: Wishbone Flashrom Controller
|
|
--
|
|
-- Copyright (C) 2017 Markus Koch <markus@notsyncing.net>
|
|
--
|
|
-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
-- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
-- -------------------------------------------------------------------------- --
|
|
|
|
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
use ieee.numeric_std.all;
|
|
|
|
package flashrom_pkg is
|
|
constant FLASHROM_PAGE_ADDR_WIDTH : integer := 12;
|
|
constant FLASHROM_COMMAND_MANUFACTURER_ID : std_logic_vector(7 downto 0) := x"9F";
|
|
constant FLASHROM_COMMAND_GET_STATUS : std_logic_vector(7 downto 0) := x"D7";
|
|
constant FLASHROM_COMMAND_CONT_ARRAY_READ : std_logic_vector(7 downto 0) := x"0B";
|
|
constant FLASHROM_COMMAND_WRITE_THROUGH_1 : std_logic_vector(7 downto 0) := x"82";
|
|
|
|
function padBits(target : std_logic_vector; other : std_logic_vector) return std_logic_vector;
|
|
end package flashrom_pkg;
|
|
|
|
package body flashrom_pkg is
|
|
function padBits(target : std_logic_vector; other : std_logic_vector) return std_logic_vector is
|
|
begin
|
|
return std_logic_vector(to_unsigned(0, target'length - other'length));
|
|
end function padBits;
|
|
|
|
end package body flashrom_pkg;
|