2020-09-09 16:45:45 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file configuration macros for riscv SOCs supporting the riscv
|
|
|
|
* privileged architecture specification
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SOC_COMMON_H_
|
|
|
|
#define __SOC_COMMON_H_
|
|
|
|
|
|
|
|
#include "chip_chipregs.h"
|
|
|
|
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
|
2022-10-05 14:05:43 +08:00
|
|
|
#ifdef CONFIG_HAS_ITE_INTC
|
2021-07-05 14:08:50 +08:00
|
|
|
/*
|
|
|
|
* Save current interrupt state of soc-level into ier_setting[] with
|
|
|
|
* disabling interrupt.
|
|
|
|
*/
|
|
|
|
void ite_intc_save_and_disable_interrupts(void);
|
|
|
|
/* Restore interrupt state of soc-level from ier_setting[], use with care. */
|
|
|
|
void ite_intc_restore_interrupts(void);
|
|
|
|
|
2020-09-09 16:45:45 +08:00
|
|
|
extern void ite_intc_irq_enable(unsigned int irq);
|
|
|
|
extern void ite_intc_irq_disable(unsigned int irq);
|
drivers: gpio: ite_it8xxx2: enable more gpio groups
This change enables A, C, D, E, G, H, I, J, K, and L groups,
and fix gpio interrupt function.
This change also pull (and rename) dt-bindings/irq.h to
dt-bindings/interrupt-controller/ite-intc.h, because it is
chip-specific.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: Ifee039981c2cc4cf5980e663702a9921e629fc1e
2021-04-21 16:35:17 +08:00
|
|
|
extern uint8_t ite_intc_get_irq_num(void);
|
2020-09-09 16:45:45 +08:00
|
|
|
extern int ite_intc_irq_is_enable(unsigned int irq);
|
2021-10-26 18:18:17 +08:00
|
|
|
extern void ite_intc_irq_polarity_set(unsigned int irq, unsigned int flags);
|
2021-04-09 17:51:09 +08:00
|
|
|
extern void ite_intc_isr_clear(unsigned int irq);
|
2022-01-28 11:37:10 +08:00
|
|
|
void ite_intc_init(void);
|
2022-03-24 13:36:41 +08:00
|
|
|
bool ite_intc_no_irq(void);
|
2022-10-05 14:05:43 +08:00
|
|
|
#endif /* CONFIG_HAS_ITE_INTC */
|
2020-09-09 16:45:45 +08:00
|
|
|
|
2021-07-05 14:08:50 +08:00
|
|
|
#ifdef CONFIG_SOC_IT8XXX2_PLL_FLASH_48M
|
|
|
|
void timer_5ms_one_shot(void);
|
|
|
|
#endif
|
|
|
|
|
2022-02-24 18:24:25 +08:00
|
|
|
uint32_t chip_get_pll_freq(void);
|
2021-09-02 18:21:51 +08:00
|
|
|
void chip_pll_ctrl(enum chip_pll_mode mode);
|
2021-10-15 13:20:47 +08:00
|
|
|
void riscv_idle(enum chip_pll_mode mode, unsigned int key);
|
2021-09-02 18:21:51 +08:00
|
|
|
|
2024-11-08 19:07:06 +08:00
|
|
|
/* Functions for managing the CPU idle state */
|
2022-05-18 18:40:19 +08:00
|
|
|
void chip_permit_idle(void);
|
|
|
|
void chip_block_idle(void);
|
|
|
|
bool cpu_idle_not_allowed(void);
|
|
|
|
|
2020-09-09 16:45:45 +08:00
|
|
|
#endif /* !_ASMLANGUAGE */
|
|
|
|
|
|
|
|
#endif /* __SOC_COMMON_H_ */
|