blob: 6a83c255076c4b12f3f11fe6d43f184ffa4a8b60 [file] [log] [blame]
// SPDX-FileCopyrightText: 2022 Efabless Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
`default_nettype none
`ifndef __USER_DEFINES_H
// User GPIO initial configuration parameters
`define __USER_DEFINES_H
// deliberately erroneous placeholder value; user required to config GPIO's to other
`define GPIO_MODE_INVALID 13'hXXXX
// Authoritive source of these MODE defs is: caravel/verilog/rtl/user_defines.v
// Useful GPIO mode values. These match the names used in defs.h.
//
`define GPIO_MODE_MGMT_STD_INPUT_NOPULL 10'h007
`define GPIO_MODE_MGMT_STD_INPUT_PULLDOWN 10'h047
`define GPIO_MODE_MGMT_STD_INPUT_PULLUP 10'h087
`define GPIO_MODE_MGMT_STD_OUTPUT 10'h00b
`define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 10'h009
`define GPIO_MODE_USER_STD_INPUT_NOPULL 10'h006
`define GPIO_MODE_USER_STD_INPUT_PULLDOWN 10'h046
`define GPIO_MODE_USER_STD_INPUT_PULLUP 10'h086
`define GPIO_MODE_USER_STD_OUTPUT 10'h00a
`define GPIO_MODE_USER_STD_BIDIRECTIONAL 10'h008
// The power-on configuration for GPIO 0 to 4 is fixed and cannot be
// modified (allowing the SPI and debug to always be accessible unless
// overridden by a flash program).
// The values below can be any of the standard types defined above,
// or they can be any 13-bit value if the user wants a non-standard
// startup state for the GPIO. By default, every GPIO from 5 to 37
// is set to power up as an input controlled by the management SoC.
// Users may want to redefine these so that the user project powers
// up in a state that can be used immediately without depending on
// the management SoC to run a startup program to configure the GPIOs.
`define USER_CONFIG_GPIO_5_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // intr ack
`define USER_CONFIG_GPIO_6_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // intr rq
`define USER_CONFIG_GPIO_7_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // bus ack
`define USER_CONFIG_GPIO_8_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // bus rq
`define USER_CONFIG_GPIO_9_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // RDY
`define USER_CONFIG_GPIO_10_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // WR
`define USER_CONFIG_GPIO_11_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // RD
`define USER_CONFIG_GPIO_12_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // STB0
`define USER_CONFIG_GPIO_13_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // STB1
`define USER_CONFIG_GPIO_14_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // DLE
// Configurations of GPIO 15 to 25 are used on caravel but not caravan.
`define USER_CONFIG_GPIO_15_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ALE
`define USER_CONFIG_GPIO_16_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 0
`define USER_CONFIG_GPIO_17_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 1
`define USER_CONFIG_GPIO_18_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 2
`define USER_CONFIG_GPIO_19_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 3
`define USER_CONFIG_GPIO_20_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 4
`define USER_CONFIG_GPIO_21_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 5
`define USER_CONFIG_GPIO_22_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 6
`define USER_CONFIG_GPIO_23_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 7
`define USER_CONFIG_GPIO_24_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 8
`define USER_CONFIG_GPIO_25_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 9
`define USER_CONFIG_GPIO_26_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 10
`define USER_CONFIG_GPIO_27_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 11
`define USER_CONFIG_GPIO_28_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 12
`define USER_CONFIG_GPIO_29_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 13
`define USER_CONFIG_GPIO_30_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 14
`define USER_CONFIG_GPIO_31_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // ADBus 15
`define USER_CONFIG_GPIO_32_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // mrst
`define USER_CONFIG_GPIO_33_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // mclk
`define USER_CONFIG_GPIO_34_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // NMI req
`define USER_CONFIG_GPIO_35_INIT GPIO_MODE_USER_STD_BIDIRECTIONAL // NMI ack
`define USER_CONFIG_GPIO_36_INIT GPIO_MODE_USER_STD_INPUT_PULLDOWN // MODE0pin
`define USER_CONFIG_GPIO_37_INIT GPIO_MODE_USER_STD_INPUT_PULLDOWN // MODE1pin
`endif // __USER_DEFINES_H