2017-03-14 22:15:59 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-08-15 15:41:21 -07:00
|
|
|
* @file SoC configuration macros for the SiFive Freedom processor
|
2017-03-14 22:15:59 +01:00
|
|
|
*/
|
|
|
|
|
2019-07-18 23:05:53 -04:00
|
|
|
#ifndef __RISCV_SIFIVE_FREEDOM_SOC_H_
|
|
|
|
#define __RISCV_SIFIVE_FREEDOM_SOC_H_
|
2017-03-14 22:15:59 +01:00
|
|
|
|
|
|
|
#include <soc_common.h>
|
|
|
|
|
2021-06-09 18:33:12 +09:00
|
|
|
#if defined(CONFIG_SOC_RISCV_SIFIVE_FREEDOM)
|
|
|
|
|
2017-03-14 22:15:59 +01:00
|
|
|
/* PINMUX IO Hardware Functions */
|
2018-08-15 15:41:21 -07:00
|
|
|
#define SIFIVE_PINMUX_IOF0 0x00
|
|
|
|
#define SIFIVE_PINMUX_IOF1 0x01
|
2017-03-14 22:15:59 +01:00
|
|
|
|
|
|
|
/* PINMUX MAX PINS */
|
2018-08-15 15:41:21 -07:00
|
|
|
#define SIFIVE_PINMUX_PINS 32
|
2017-03-14 22:15:59 +01:00
|
|
|
|
2018-04-04 22:11:07 +02:00
|
|
|
/* Clock controller. */
|
|
|
|
#define PRCI_BASE_ADDR 0x10008000
|
|
|
|
|
|
|
|
/* Always ON Domain */
|
2018-08-15 15:41:21 -07:00
|
|
|
#define SIFIVE_PMUIE 0x10000140
|
|
|
|
#define SIFIVE_PMUCAUSE 0x10000144
|
|
|
|
#define SIFIVE_PMUSLEEP 0x10000148
|
|
|
|
#define SIFIVE_PMUKEY 0x1000014C
|
|
|
|
#define SIFIVE_SLEEP_KEY_VAL 0x0051F15E
|
2018-04-04 22:11:07 +02:00
|
|
|
|
2018-08-15 15:41:21 -07:00
|
|
|
#define SIFIVE_BACKUP_REG_BASE 0x10000080
|
2018-04-04 22:11:07 +02:00
|
|
|
|
2021-08-22 15:54:41 +09:00
|
|
|
#elif defined(CONFIG_SOC_RISCV_SIFIVE_FU540) || defined(CONFIG_SOC_RISCV_SIFIVE_FU740)
|
2021-06-09 18:33:12 +09:00
|
|
|
|
|
|
|
/* Clock controller. */
|
|
|
|
#define PRCI_BASE_ADDR 0x10000000
|
|
|
|
|
2022-01-19 17:31:21 +09:00
|
|
|
/* PINMUX MAX PINS */
|
|
|
|
#define SIFIVE_PINMUX_PINS 16
|
|
|
|
|
2021-06-09 18:33:12 +09:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Timer configuration */
|
|
|
|
#define RISCV_MTIME_BASE 0x0200BFF8
|
|
|
|
#define RISCV_MTIMECMP_BASE 0x02004000
|
|
|
|
|
2017-03-14 22:15:59 +01:00
|
|
|
/* lib-c hooks required RAM defined variables */
|
2019-12-26 16:08:19 +01:00
|
|
|
#define RISCV_RAM_BASE CONFIG_SRAM_BASE_ADDRESS
|
|
|
|
#define RISCV_RAM_SIZE KB(CONFIG_SRAM_SIZE)
|
2017-03-14 22:15:59 +01:00
|
|
|
|
2019-07-18 23:05:53 -04:00
|
|
|
#endif /* __RISCV_SIFIVE_FREEDOM_SOC_H_ */
|