This commit is contained in:
刘可亮
2024-06-04 19:00:30 +08:00
parent 990c72f5be
commit 0a13af6a1d
1668 changed files with 342810 additions and 37726 deletions

View File

@@ -19,7 +19,7 @@ extern "C" {
/* Luban-Lite version information */
#define LL_VERSION 1 /**< major version number */
#define LL_SUBVERSION 0 /**< minor version number */
#define LL_REVISION 1 /**< revise version number */
#define LL_REVISION 5 /**< revise version number */
typedef __signed__ char s8;
typedef unsigned char u8;
@@ -242,6 +242,8 @@ typedef unsigned long ptr_t;
#define ALIGN_UP(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define ALIGN_DOWN(x, a) ((x) & (~((typeof(x))(a)-1)))
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a)-1)) == 0)
#define PAD_COUNT(s, pad) (((s) - 1) / (pad) + 1)
#define PAD_SIZE(s, pad) (PAD_COUNT(s, pad) * pad)
#define ALLOC_ALIGN_BUFFER_PAD(type, name, size, align, pad) \

View File

@@ -22,6 +22,14 @@ extern "C" {
(~(0U) >> (BITS_PER_LONG - 1 - (h))))
#define GENMASK_UL(h, l) (((~(0UL)) - ((1UL) << (l)) + 1) & \
(~(0UL) >> (BITS_PER_LONG - 1 - (h))))
#define uswap_16(x) \
((((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8))
#define uswap_32(x) \
((((x) & 0xff000000) >> 24) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x000000ff) << 24))
#define cpu_to_le16(val) (val)
#define cpu_to_le32(val) (val)
@@ -29,6 +37,12 @@ extern "C" {
#define le16_to_cpu(val) (val)
#define le32_to_cpu(val) (val)
#define cpu_to_be16(val) uswap_16(val)
#define cpu_to_be32(val) uswap_32(val)
#define be16_to_cpu(val) uswap_16(val)
#define be32_to_cpu(val) uswap_32(val)
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
#define readl_cpu(c) ({ u32 __r = le32_to_cpu(__raw_readl(c)); __r; })

View File

@@ -14,8 +14,8 @@ enum aic_reboot_reason {
REBOOT_REASON_CMD_REBOOT = 1,
REBOOT_REASON_CMD_SHUTDOWN = 2,
REBOOT_REASON_SUSPEND = 3,
REBOOT_REASON_UPGRADE = 4,
REBOOT_REASON_FASTBOOT = 5,
REBOOT_REASON_UPGRADE = 4, /* Goto BROM upgrade mode */
REBOOT_REASON_BL_UPGRADE = 5, /* Goto Bootloader upgrade mode */
#endif
#if defined(AIC_WRI_DRV_V13)
REBOOT_REASON_CS_CMD_REBOOT = 1,
@@ -24,8 +24,8 @@ enum aic_reboot_reason {
REBOOT_REASON_SE_CMD_REBOOT = 4,
REBOOT_REASON_CMD_SHUTDOWN = 5,
REBOOT_REASON_SUSPEND = 6,
REBOOT_REASON_UPGRADE = 7,
REBOOT_REASON_FASTBOOT = 8,
REBOOT_REASON_UPGRADE = 7, /* Goto BROM upgrade mode */
REBOOT_REASON_BL_UPGRADE = 8, /* Goto Bootloader upgrade mode */
#endif
/* Some software exception reason */
REBOOT_REASON_SW_LOCKUP = 8,
@@ -43,25 +43,26 @@ enum aic_reboot_reason {
#endif
#if defined(AIC_WRI_DRV_V13)
REBOOT_REASON_VDD11_SP_POR = 17,
REBOOT_REASON_VDD11_SW_POR = 18,
REBOOT_REASON_RTC_POR = 19,
REBOOT_REASON_PIN_RST = 20,
REBOOT_REASON_THS_RST = 21,
REBOOT_REASON_SP_WDOG_SYS_RST = 22,
REBOOT_REASON_SP_WDOG_CPU_RST = 23,
REBOOT_REASON_SP_DM_NDM_RST = 24,
REBOOT_REASON_SP_DM_CPU_RST = 25,
REBOOT_REASON_CS_WDOG_SYS_RST = 26,
REBOOT_REASON_CS_WDOG_CPU_RST = 27,
REBOOT_REASON_CS_DM_NDM_RST = 28,
REBOOT_REASON_CS_DM_CPU_RST = 29,
REBOOT_REASON_SC_WDOG_SYS_RST = 30,
REBOOT_REASON_SC_WDOG_CPU_RST = 31,
REBOOT_REASON_SC_DM_NDM_RST = 32,
REBOOT_REASON_SC_DM_CPU_RST = 33,
REBOOT_REASON_SE_WDOG_SYS_RST = 34,
REBOOT_REASON_SE_WDOG_CPU_RST = 35,
REBOOT_REASON_SE_DM_NDM_RST = 36,
REBOOT_REASON_VDD11_SW_POR,
REBOOT_REASON_VDD11_C908_POR,
REBOOT_REASON_RTC_POR,
REBOOT_REASON_PIN_RST,
REBOOT_REASON_THS_RST,
REBOOT_REASON_SP_WDOG_SYS_RST,
REBOOT_REASON_SP_WDOG_CPU_RST,
REBOOT_REASON_SP_DM_NDM_RST,
REBOOT_REASON_SP_DM_CPU_RST,
REBOOT_REASON_CS_WDOG_SYS_RST,
REBOOT_REASON_CS_WDOG_CPU_RST,
REBOOT_REASON_CS_DM_NDM_RST,
REBOOT_REASON_CS_DM_CPU_RST,
REBOOT_REASON_SC_WDOG_SYS_RST,
REBOOT_REASON_SC_WDOG_CPU_RST,
REBOOT_REASON_SC_DM_NDM_RST,
REBOOT_REASON_SC_DM_CPU_RST,
REBOOT_REASON_SE_WDOG_SYS_RST,
REBOOT_REASON_SE_WDOG_CPU_RST,
REBOOT_REASON_SE_DM_NDM_RST,
#endif
REBOOT_REASON_INVALID = 0xff,
@@ -71,7 +72,8 @@ enum aic_reboot_reason {
void aic_set_reboot_reason(enum aic_reboot_reason reason);
enum aic_reboot_reason aic_get_reboot_reason(void);
void aic_clr_reboot_reason_rtc(void);
void aic_clr_reboot_reason(void);
void aic_show_gtc_time(char *tag, u32 val);
void aic_show_startup_time(void);