[HUST CSE] Fix many abnormal symbols in annotations and format code

This commit is contained in:
7YZ7 2023-04-18 10:26:23 +08:00 committed by GitHub
parent 3f44132ade
commit 501b22aabe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
211 changed files with 1349 additions and 1350 deletions

View File

@ -1089,7 +1089,7 @@ typedef struct
//#define ANA_REGA_PSLSEL ANA_REGA_PSLSEL_Msk /*!< power switch level selection */ //#define ANA_REGA_PSLSEL ANA_REGA_PSLSEL_Msk /*!< power switch level selection */
//#define ANA_REGA_PD_PORH_Pos (5U) //#define ANA_REGA_PD_PORH_Pos (5U)
//#define ANA_REGA_PD_PORH_Msk (0x1U << ANA_REGA_PD_PORH_Pos) /*!< 0x00000020 */ //#define ANA_REGA_PD_PORH_Msk (0x1U << ANA_REGA_PD_PORH_Pos) /*!< 0x00000020 */
//#define ANA_REGA_PD_PORH ANA_REGA_PD_PORH_Msk /*!< PD POR_H module, output <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD> when PD */ //#define ANA_REGA_PD_PORH ANA_REGA_PD_PORH_Msk /*!< PD POR_H module, output '1' when PD */
//#define ANA_REGA_PD_RCL_Pos (6U) //#define ANA_REGA_PD_RCL_Pos (6U)
//#define ANA_REGA_PD_RCL_Msk (0x1U << ANA_REGA_PD_RCL_Pos) /*!< 0x00000040 */ //#define ANA_REGA_PD_RCL_Msk (0x1U << ANA_REGA_PD_RCL_Pos) /*!< 0x00000040 */
//#define ANA_REGA_PD_RCL ANA_REGA_PD_RCL_Msk /*!< PD 32K RC module */ //#define ANA_REGA_PD_RCL ANA_REGA_PD_RCL_Msk /*!< PD 32K RC module */

View File

@ -858,11 +858,11 @@ FLASH_Status FLASH_OB_Erase(void)
/* Get the actual read protection Option Byte value */ /* Get the actual read protection Option Byte value */
if(FLASH_OB_GetRDP() != RESET) if(FLASH_OB_GetRDP() != RESET)
{ {
rdptmp = 0x0000 | 0xff00; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1 rdptmp = 0x0000 | 0xff00; //读保护级别1
} }
else else
{ {
rdptmp = OB_RDP_Level_0 | 0x5500; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0 rdptmp = OB_RDP_Level_0 | 0x5500; //读保护级别0
} }
/*Get iwdg value */ /*Get iwdg value */

View File

@ -1303,7 +1303,7 @@ void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState)
{ {
uint32_t tmpreg = 0; uint32_t tmpreg = 0;
/*<EFBFBD><EFBFBD>Edge<EFBFBD>ĸ<EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>λ<EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD>*/ /* 设置Edge的边缘触发没有特定位的情况 */
/* Check the parameters */ /* Check the parameters */
assert_param(IS_RTC_TIMESTAMP_EDGE(RTC_TimeStampEdge)); assert_param(IS_RTC_TIMESTAMP_EDGE(RTC_TimeStampEdge));
assert_param(IS_FUNCTIONAL_STATE(NewState)); assert_param(IS_FUNCTIONAL_STATE(NewState));

View File

@ -68,7 +68,7 @@ ErrStatus rtc_deinit(void)
error_status = rtc_init_mode_enter(); error_status = rtc_init_mode_enter();
if(ERROR != error_status) { if(ERROR != error_status) {
/* reset RTC_CTL register, but RTC_CTL[2<EFBFBD><EFBFBD>0] */ /* reset RTC_CTL register, but RTC_CTL[2:0] */
RTC_CTL &= (RTC_REGISTER_RESET | RTC_CTL_WTCS); RTC_CTL &= (RTC_REGISTER_RESET | RTC_CTL_WTCS);
/* before reset RTC_TIME and RTC_DATE, BPSHAD bit in RTC_CTL should be reset as the condition. /* before reset RTC_TIME and RTC_DATE, BPSHAD bit in RTC_CTL should be reset as the condition.
in order to read calendar from shadow register, not the real registers being reset */ in order to read calendar from shadow register, not the real registers being reset */
@ -76,7 +76,7 @@ ErrStatus rtc_deinit(void)
RTC_DATE = RTC_DATE_RESET; RTC_DATE = RTC_DATE_RESET;
RTC_PSC = RTC_PSC_RESET; RTC_PSC = RTC_PSC_RESET;
/* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2<EFBFBD><EFBFBD>0] */ /* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2:0] */
/* wait until the WTWF flag to be set */ /* wait until the WTWF flag to be set */
do { do {
flag_status = RTC_STAT & RTC_STAT_WTWF; flag_status = RTC_STAT & RTC_STAT_WTWF;
@ -1095,7 +1095,7 @@ ErrStatus rtc_wakeup_clock_set(uint8_t wakeup_clock)
/* disable the write protection */ /* disable the write protection */
RTC_WPK = RTC_UNLOCK_KEY1; RTC_WPK = RTC_UNLOCK_KEY1;
RTC_WPK = RTC_UNLOCK_KEY2; RTC_WPK = RTC_UNLOCK_KEY2;
/* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2<EFBFBD><EFBFBD>0] */ /* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2:0] */
/* wait until the WTWF flag to be set */ /* wait until the WTWF flag to be set */
do { do {
flag_status = RTC_STAT & RTC_STAT_WTWF; flag_status = RTC_STAT & RTC_STAT_WTWF;

View File

@ -68,7 +68,7 @@ ErrStatus rtc_deinit(void)
error_status = rtc_init_mode_enter(); error_status = rtc_init_mode_enter();
if(ERROR != error_status){ if(ERROR != error_status){
/* reset RTC_CTL register, but RTC_CTL[2<EFBFBD><EFBFBD>0] */ /* reset RTC_CTL register, but RTC_CTL[2:0] */
RTC_CTL &= (RTC_REGISTER_RESET | RTC_CTL_WTCS); RTC_CTL &= (RTC_REGISTER_RESET | RTC_CTL_WTCS);
/* before reset RTC_TIME and RTC_DATE, BPSHAD bit in RTC_CTL should be reset as the condition. /* before reset RTC_TIME and RTC_DATE, BPSHAD bit in RTC_CTL should be reset as the condition.
in order to read calendar from shadow register, not the real registers being reset */ in order to read calendar from shadow register, not the real registers being reset */
@ -76,7 +76,7 @@ ErrStatus rtc_deinit(void)
RTC_DATE = RTC_DATE_RESET; RTC_DATE = RTC_DATE_RESET;
RTC_PSC = RTC_PSC_RESET; RTC_PSC = RTC_PSC_RESET;
/* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2<EFBFBD><EFBFBD>0] */ /* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2:0] */
/* wait until the WTWF flag to be set */ /* wait until the WTWF flag to be set */
do{ do{
flag_status = RTC_STAT & RTC_STAT_WTWF; flag_status = RTC_STAT & RTC_STAT_WTWF;
@ -1096,7 +1096,7 @@ ErrStatus rtc_wakeup_clock_set(uint8_t wakeup_clock)
/* disable the write protection */ /* disable the write protection */
RTC_WPK = RTC_UNLOCK_KEY1; RTC_WPK = RTC_UNLOCK_KEY1;
RTC_WPK = RTC_UNLOCK_KEY2; RTC_WPK = RTC_UNLOCK_KEY2;
/* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2<EFBFBD><EFBFBD>0] */ /* only when RTC_CTL_WTEN=0 and RTC_STAT_WTWF=1 can write RTC_CTL[2:0] */
/* wait until the WTWF flag to be set */ /* wait until the WTWF flag to be set */
do{ do{
flag_status = RTC_STAT & RTC_STAT_WTWF; flag_status = RTC_STAT & RTC_STAT_WTWF;

View File

@ -25077,7 +25077,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25091,7 +25091,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25107,7 +25107,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25388,7 +25388,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25402,7 +25402,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25418,7 +25418,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25699,7 +25699,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25713,7 +25713,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -25729,7 +25729,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26010,7 +26010,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26024,7 +26024,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26040,7 +26040,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26321,7 +26321,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26335,7 +26335,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26351,7 +26351,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26632,7 +26632,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26646,7 +26646,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26662,7 +26662,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26943,7 +26943,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26957,7 +26957,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -26973,7 +26973,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -27254,7 +27254,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -27268,7 +27268,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -27284,7 +27284,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>

View File

@ -34249,7 +34249,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34263,7 +34263,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34279,7 +34279,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34560,7 +34560,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34574,7 +34574,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34590,7 +34590,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34871,7 +34871,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34885,7 +34885,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -34901,7 +34901,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35182,7 +35182,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35196,7 +35196,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35212,7 +35212,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35493,7 +35493,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35507,7 +35507,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35523,7 +35523,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35804,7 +35804,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35818,7 +35818,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -35834,7 +35834,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -36115,7 +36115,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -36129,7 +36129,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -36145,7 +36145,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -36426,7 +36426,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x8: 256 transfers 0x8: 256 transfers
0x9:512 transfers 0x9:512 transfers
0xa: 1024 transfers 0xa: 1024 transfers
0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception</description> 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>24</bitOffset> <bitOffset>24</bitOffset>
<bitWidth>4</bitWidth> <bitWidth>4</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -36440,7 +36440,7 @@ The burst transfer byte number is (SrcBurstSize * SrcWidth).
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>21</bitOffset> <bitOffset>21</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>
@ -36456,7 +36456,7 @@ See field SrcBurstSize above for the definition of burst transfer byte number an
0x3: Double word transfer 0x3: Double word transfer
0x4: Quad word transfer 0x4: Quad word transfer
0x5: Eight word transfer 0x5: Eight word transfer
0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception</description> 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception</description>
<bitOffset>18</bitOffset> <bitOffset>18</bitOffset>
<bitWidth>3</bitWidth> <bitWidth>3</bitWidth>
<access>read-write</access> <access>read-write</access>

View File

@ -273,7 +273,7 @@ typedef struct {
* 0x8: 256 transfers * 0x8: 256 transfers
* 0x9:512 transfers * 0x9:512 transfers
* 0xa: 1024 transfers * 0xa: 1024 transfers
* 0xb <EFBFBD>?0xf: Reserved, setting this field with a reserved value triggers the error exception * 0xb -0xf: Reserved, setting this field with a reserved value triggers the error exception
*/ */
#define DMA_CHCTRL_CTRL_SRCBURSTSIZE_MASK (0xF000000UL) #define DMA_CHCTRL_CTRL_SRCBURSTSIZE_MASK (0xF000000UL)
#define DMA_CHCTRL_CTRL_SRCBURSTSIZE_SHIFT (24U) #define DMA_CHCTRL_CTRL_SRCBURSTSIZE_SHIFT (24U)
@ -290,7 +290,7 @@ typedef struct {
* 0x3: Double word transfer * 0x3: Double word transfer
* 0x4: Quad word transfer * 0x4: Quad word transfer
* 0x5: Eight word transfer * 0x5: Eight word transfer
* 0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception * 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception
*/ */
#define DMA_CHCTRL_CTRL_SRCWIDTH_MASK (0xE00000UL) #define DMA_CHCTRL_CTRL_SRCWIDTH_MASK (0xE00000UL)
#define DMA_CHCTRL_CTRL_SRCWIDTH_SHIFT (21U) #define DMA_CHCTRL_CTRL_SRCWIDTH_SHIFT (21U)
@ -309,7 +309,7 @@ typedef struct {
* 0x3: Double word transfer * 0x3: Double word transfer
* 0x4: Quad word transfer * 0x4: Quad word transfer
* 0x5: Eight word transfer * 0x5: Eight word transfer
* 0x6<EFBFBD>?x7: Reserved, setting this field with a reserved value triggers the error exception * 0x6-x7: Reserved, setting this field with a reserved value triggers the error exception
*/ */
#define DMA_CHCTRL_CTRL_DSTWIDTH_MASK (0x1C0000UL) #define DMA_CHCTRL_CTRL_DSTWIDTH_MASK (0x1C0000UL)
#define DMA_CHCTRL_CTRL_DSTWIDTH_SHIFT (18U) #define DMA_CHCTRL_CTRL_DSTWIDTH_SHIFT (18U)

View File

@ -1020,7 +1020,7 @@ static int rt_hw_imxrt_eth_init(void)
imxrt_eth_device.dev_addr[4] = 0x22; imxrt_eth_device.dev_addr[4] = 0x22;
imxrt_eth_device.dev_addr[5] = 0x33; imxrt_eth_device.dev_addr[5] = 0x33;
imxrt_eth_device.speed = kENET_MiiSpeed100M;//Ҫ֧<EFBFBD><EFBFBD>ǧ<EFBFBD>ף<EFBFBD>ֱ<EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>ΪkENET_MiiSpeed1000M imxrt_eth_device.speed = kENET_MiiSpeed100M;//要支持千兆,直接赋值为kENET_MiiSpeed1000M
imxrt_eth_device.duplex = kENET_MiiFullDuplex; imxrt_eth_device.duplex = kENET_MiiFullDuplex;
imxrt_eth_device.enet_base = ENET_1G; imxrt_eth_device.enet_base = ENET_1G;

View File

@ -117,10 +117,10 @@ static void * ThreadforKeyGet(void * lpParam)
#endif /* not _WIN32*/ #endif /* not _WIN32*/
{ {
/* /*
* left key(<EFBFBD><EFBFBD>)<EFBFBD><EFBFBD> 0xe04b * left key() 0xe04b
* up key(<EFBFBD><EFBFBD>)<EFBFBD><EFBFBD> 0xe048 * up key() 0xe048
* right key(<EFBFBD><EFBFBD>)<EFBFBD><EFBFBD> 0xe04d * right key() 0xe04d
* down key(<EFBFBD><EFBFBD>)<EFBFBD><EFBFBD> 0xe050 * down key() 0xe050
*/ */
unsigned char key; unsigned char key;

View File

@ -21,7 +21,7 @@ extern "C" {
#define OV2640_PID 0X2642 #define OV2640_PID 0X2642
//褰撻<EFBFBD>夋嫨DSP鍦板潃(0XFF=0X00)鏃<>,OV2640鐨凞SP瀵勫瓨鍣ㄥ湴鍧<E6B9B4>鏄犲皠琛<E79AA0> //当选择DSP地址(0XFF=0X00)时OV2640的DSP寄存器地址映射表
#define OV2640_DSP_R_BYPASS 0x05 #define OV2640_DSP_R_BYPASS 0x05
#define OV2640_DSP_Qs 0x44 #define OV2640_DSP_Qs 0x44
#define OV2640_DSP_CTRL 0x50 #define OV2640_DSP_CTRL 0x50
@ -57,7 +57,7 @@ extern "C" {
#define OV2640_DSP_P_STATUS 0xFE #define OV2640_DSP_P_STATUS 0xFE
#define OV2640_DSP_RA_DLMT 0xFF #define OV2640_DSP_RA_DLMT 0xFF
//褰撻<EFBFBD>夋嫨浼犳劅鍣ㄥ湴鍧<EFBFBD>(0XFF=0X01)鏃<>,OV2640鐨凞SP瀵勫瓨鍣ㄥ湴鍧<E6B9B4>鏄犲皠琛<E79AA0> //当选择DSP地址(0XFF=0X01)时OV2640的DSP寄存器地址映射表
#define OV2640_SENSOR_GAIN 0x00 #define OV2640_SENSOR_GAIN 0x00
#define OV2640_SENSOR_COM1 0x03 #define OV2640_SENSOR_COM1 0x03
#define OV2640_SENSOR_REG04 0x04 #define OV2640_SENSOR_REG04 0x04

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -55,195 +55,195 @@
int fdt_check_header(const void *fdt) int fdt_check_header(const void *fdt)
{ {
if (fdt_magic(fdt) == FDT_MAGIC) { if (fdt_magic(fdt) == FDT_MAGIC) {
/* Complete tree */ /* Complete tree */
if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
return -FDT_ERR_BADVERSION; return -FDT_ERR_BADVERSION;
if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION) if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
return -FDT_ERR_BADVERSION; return -FDT_ERR_BADVERSION;
} else if (fdt_magic(fdt) == FDT_SW_MAGIC) { } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
/* Unfinished sequential-write blob */ /* Unfinished sequential-write blob */
if (fdt_size_dt_struct(fdt) == 0) if (fdt_size_dt_struct(fdt) == 0)
return -FDT_ERR_BADSTATE; return -FDT_ERR_BADSTATE;
} else { } else {
return -FDT_ERR_BADMAGIC; return -FDT_ERR_BADMAGIC;
} }
return 0; return 0;
} }
const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
{ {
unsigned absoffset = offset + fdt_off_dt_struct(fdt); unsigned absoffset = offset + fdt_off_dt_struct(fdt);
if ((absoffset < offset) if ((absoffset < offset)
|| ((absoffset + len) < absoffset) || ((absoffset + len) < absoffset)
|| (absoffset + len) > fdt_totalsize(fdt)) || (absoffset + len) > fdt_totalsize(fdt))
return NULL; return NULL;
if (fdt_version(fdt) >= 0x11) if (fdt_version(fdt) >= 0x11)
if (((offset + len) < offset) if (((offset + len) < offset)
|| ((offset + len) > fdt_size_dt_struct(fdt))) || ((offset + len) > fdt_size_dt_struct(fdt)))
return NULL; return NULL;
return _fdt_offset_ptr(fdt, offset); return _fdt_offset_ptr(fdt, offset);
} }
uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset) uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
{ {
const fdt32_t *tagp, *lenp; const fdt32_t *tagp, *lenp;
uint32_t tag; uint32_t tag;
int offset = startoffset; int offset = startoffset;
const char *p; const char *p;
*nextoffset = -FDT_ERR_TRUNCATED; *nextoffset = -FDT_ERR_TRUNCATED;
tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
if (!tagp) if (!tagp)
return FDT_END; /* premature end */ return FDT_END; /* premature end */
tag = fdt32_to_cpu(*tagp); tag = fdt32_to_cpu(*tagp);
offset += FDT_TAGSIZE; offset += FDT_TAGSIZE;
*nextoffset = -FDT_ERR_BADSTRUCTURE; *nextoffset = -FDT_ERR_BADSTRUCTURE;
switch (tag) { switch (tag) {
case FDT_BEGIN_NODE: case FDT_BEGIN_NODE:
/* skip name */ /* skip name */
do { do {
p = fdt_offset_ptr(fdt, offset++, 1); p = fdt_offset_ptr(fdt, offset++, 1);
} while (p && (*p != '\0')); } while (p && (*p != '\0'));
if (!p) if (!p)
return FDT_END; /* premature end */ return FDT_END; /* premature end */
break; break;
case FDT_PROP: case FDT_PROP:
lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
if (!lenp) if (!lenp)
return FDT_END; /* premature end */ return FDT_END; /* premature end */
/* skip-name offset, length and value */ /* skip-name offset, length and value */
offset += sizeof(struct fdt_property) - FDT_TAGSIZE offset += sizeof(struct fdt_property) - FDT_TAGSIZE
+ fdt32_to_cpu(*lenp); + fdt32_to_cpu(*lenp);
break; break;
case FDT_END: case FDT_END:
case FDT_END_NODE: case FDT_END_NODE:
case FDT_NOP: case FDT_NOP:
break; break;
default: default:
return FDT_END; return FDT_END;
} }
if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset))
return FDT_END; /* premature end */ return FDT_END; /* premature end */
*nextoffset = FDT_TAGALIGN(offset); *nextoffset = FDT_TAGALIGN(offset);
return tag; return tag;
} }
int _fdt_check_node_offset(const void *fdt, int offset) int _fdt_check_node_offset(const void *fdt, int offset)
{ {
if ((offset < 0) || (offset % FDT_TAGSIZE) if ((offset < 0) || (offset % FDT_TAGSIZE)
|| (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)) || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
return -FDT_ERR_BADOFFSET; return -FDT_ERR_BADOFFSET;
return offset; return offset;
} }
int _fdt_check_prop_offset(const void *fdt, int offset) int _fdt_check_prop_offset(const void *fdt, int offset)
{ {
if ((offset < 0) || (offset % FDT_TAGSIZE) if ((offset < 0) || (offset % FDT_TAGSIZE)
|| (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)) || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
return -FDT_ERR_BADOFFSET; return -FDT_ERR_BADOFFSET;
return offset; return offset;
} }
int fdt_next_node(const void *fdt, int offset, int *depth) int fdt_next_node(const void *fdt, int offset, int *depth)
{ {
int nextoffset = 0; int nextoffset = 0;
uint32_t tag; uint32_t tag;
if (offset >= 0) if (offset >= 0)
if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0) if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0)
return nextoffset; return nextoffset;
do { do {
offset = nextoffset; offset = nextoffset;
tag = fdt_next_tag(fdt, offset, &nextoffset); tag = fdt_next_tag(fdt, offset, &nextoffset);
switch (tag) { switch (tag) {
case FDT_PROP: case FDT_PROP:
case FDT_NOP: case FDT_NOP:
break; break;
case FDT_BEGIN_NODE: case FDT_BEGIN_NODE:
if (depth) if (depth)
(*depth)++; (*depth)++;
break; break;
case FDT_END_NODE: case FDT_END_NODE:
if (depth && ((--(*depth)) < 0)) if (depth && ((--(*depth)) < 0))
return nextoffset; return nextoffset;
break; break;
case FDT_END: case FDT_END:
if ((nextoffset >= 0) if ((nextoffset >= 0)
|| ((nextoffset == -FDT_ERR_TRUNCATED) && !depth)) || ((nextoffset == -FDT_ERR_TRUNCATED) && !depth))
return -FDT_ERR_NOTFOUND; return -FDT_ERR_NOTFOUND;
else else
return nextoffset; return nextoffset;
} }
} while (tag != FDT_BEGIN_NODE); } while (tag != FDT_BEGIN_NODE);
return offset; return offset;
} }
int fdt_first_subnode(const void *fdt, int offset) int fdt_first_subnode(const void *fdt, int offset)
{ {
int depth = 0; int depth = 0;
offset = fdt_next_node(fdt, offset, &depth); offset = fdt_next_node(fdt, offset, &depth);
if (offset < 0 || depth != 1) if (offset < 0 || depth != 1)
return -FDT_ERR_NOTFOUND; return -FDT_ERR_NOTFOUND;
return offset; return offset;
} }
int fdt_next_subnode(const void *fdt, int offset) int fdt_next_subnode(const void *fdt, int offset)
{ {
int depth = 1; int depth = 1;
/* /*
* With respect to the parent, the depth of the next subnode will be * With respect to the parent, the depth of the next subnode will be
* the same as the last. * the same as the last.
*/ */
do { do {
offset = fdt_next_node(fdt, offset, &depth); offset = fdt_next_node(fdt, offset, &depth);
if (offset < 0 || depth < 1) if (offset < 0 || depth < 1)
return -FDT_ERR_NOTFOUND; return -FDT_ERR_NOTFOUND;
} while (depth > 1); } while (depth > 1);
return offset; return offset;
} }
const char *_fdt_find_string(const char *strtab, int tabsize, const char *s) const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
{ {
int len = strlen(s) + 1; int len = strlen(s) + 1;
const char *last = strtab + tabsize - len; const char *last = strtab + tabsize - len;
const char *p; const char *p;
for (p = strtab; p <= last; p++) for (p = strtab; p <= last; p++)
if (memcmp(p, s, len) == 0) if (memcmp(p, s, len) == 0)
return p; return p;
return NULL; return NULL;
} }
int fdt_move(const void *fdt, void *buf, int bufsize) int fdt_move(const void *fdt, void *buf, int bufsize)
{ {
FDT_CHECK_HEADER(fdt); FDT_CHECK_HEADER(fdt);
if (fdt_totalsize(fdt) > bufsize) if (fdt_totalsize(fdt) > bufsize)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
memmove(buf, fdt, fdt_totalsize(fdt)); memmove(buf, fdt, fdt_totalsize(fdt));
return 0; return 0;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -57,28 +57,28 @@
int fdt_create_empty_tree(void *buf, int bufsize) int fdt_create_empty_tree(void *buf, int bufsize)
{ {
int err; int err;
err = fdt_create(buf, bufsize); err = fdt_create(buf, bufsize);
if (err) if (err)
return err; return err;
err = fdt_finish_reservemap(buf); err = fdt_finish_reservemap(buf);
if (err) if (err)
return err; return err;
err = fdt_begin_node(buf, ""); err = fdt_begin_node(buf, "");
if (err) if (err)
return err; return err;
err = fdt_end_node(buf); err = fdt_end_node(buf);
if (err) if (err)
return err; return err;
err = fdt_finish(buf); err = fdt_finish(buf);
if (err) if (err)
return err; return err;
return fdt_open_into(buf, buf, bufsize); return fdt_open_into(buf, buf, bufsize);
} }

File diff suppressed because it is too large Load Diff

View File

@ -54,436 +54,436 @@
#include "libfdt_internal.h" #include "libfdt_internal.h"
static int _fdt_blocks_misordered(const void *fdt, static int _fdt_blocks_misordered(const void *fdt,
int mem_rsv_size, int struct_size) int mem_rsv_size, int struct_size)
{ {
return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8)) return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8))
|| (fdt_off_dt_struct(fdt) < || (fdt_off_dt_struct(fdt) <
(fdt_off_mem_rsvmap(fdt) + mem_rsv_size)) (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
|| (fdt_off_dt_strings(fdt) < || (fdt_off_dt_strings(fdt) <
(fdt_off_dt_struct(fdt) + struct_size)) (fdt_off_dt_struct(fdt) + struct_size))
|| (fdt_totalsize(fdt) < || (fdt_totalsize(fdt) <
(fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt))); (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
} }
static int _fdt_rw_check_header(void *fdt) static int _fdt_rw_check_header(void *fdt)
{ {
FDT_CHECK_HEADER(fdt); FDT_CHECK_HEADER(fdt);
if (fdt_version(fdt) < 17) if (fdt_version(fdt) < 17)
return -FDT_ERR_BADVERSION; return -FDT_ERR_BADVERSION;
if (_fdt_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry), if (_fdt_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
fdt_size_dt_struct(fdt))) fdt_size_dt_struct(fdt)))
return -FDT_ERR_BADLAYOUT; return -FDT_ERR_BADLAYOUT;
if (fdt_version(fdt) > 17) if (fdt_version(fdt) > 17)
fdt_set_version(fdt, 17); fdt_set_version(fdt, 17);
return 0; return 0;
} }
#define FDT_RW_CHECK_HEADER(fdt) \ #define FDT_RW_CHECK_HEADER(fdt) \
{ \ { \
int __err; \ int __err; \
if ((__err = _fdt_rw_check_header(fdt)) != 0) \ if ((__err = _fdt_rw_check_header(fdt)) != 0) \
return __err; \ return __err; \
} }
static inline int _fdt_data_size(void *fdt) static inline int _fdt_data_size(void *fdt)
{ {
return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt); return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
} }
static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen) static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
{ {
char *p = splicepoint; char *p = splicepoint;
char *end = (char *)fdt + _fdt_data_size(fdt); char *end = (char *)fdt + _fdt_data_size(fdt);
if (((p + oldlen) < p) || ((p + oldlen) > end)) if (((p + oldlen) < p) || ((p + oldlen) > end))
return -FDT_ERR_BADOFFSET; return -FDT_ERR_BADOFFSET;
if ((p < (char *)fdt) || ((end - oldlen + newlen) < (char *)fdt)) if ((p < (char *)fdt) || ((end - oldlen + newlen) < (char *)fdt))
return -FDT_ERR_BADOFFSET; return -FDT_ERR_BADOFFSET;
if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt))) if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt)))
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
memmove(p + newlen, p + oldlen, end - p - oldlen); memmove(p + newlen, p + oldlen, end - p - oldlen);
return 0; return 0;
} }
static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p, static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
int oldn, int newn) int oldn, int newn)
{ {
int delta = (newn - oldn) * sizeof(*p); int delta = (newn - oldn) * sizeof(*p);
int err; int err;
err = _fdt_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p)); err = _fdt_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
if (err) if (err)
return err; return err;
fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta); fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta); fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
return 0; return 0;
} }
static int _fdt_splice_struct(void *fdt, void *p, static int _fdt_splice_struct(void *fdt, void *p,
int oldlen, int newlen) int oldlen, int newlen)
{ {
int delta = newlen - oldlen; int delta = newlen - oldlen;
int err; int err;
if ((err = _fdt_splice(fdt, p, oldlen, newlen))) if ((err = _fdt_splice(fdt, p, oldlen, newlen)))
return err; return err;
fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta); fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta); fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
return 0; return 0;
} }
static int _fdt_splice_string(void *fdt, int newlen) static int _fdt_splice_string(void *fdt, int newlen)
{ {
void *p = (char *)fdt void *p = (char *)fdt
+ fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt); + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
int err; int err;
if ((err = _fdt_splice(fdt, p, 0, newlen))) if ((err = _fdt_splice(fdt, p, 0, newlen)))
return err; return err;
fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen); fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
return 0; return 0;
} }
static int _fdt_find_add_string(void *fdt, const char *s) static int _fdt_find_add_string(void *fdt, const char *s)
{ {
char *strtab = (char *)fdt + fdt_off_dt_strings(fdt); char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
const char *p; const char *p;
char *new; char *new;
int len = strlen(s) + 1; int len = strlen(s) + 1;
int err; int err;
p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s); p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
if (p) if (p)
/* found it */ /* found it */
return (p - strtab); return (p - strtab);
new = strtab + fdt_size_dt_strings(fdt); new = strtab + fdt_size_dt_strings(fdt);
err = _fdt_splice_string(fdt, len); err = _fdt_splice_string(fdt, len);
if (err) if (err)
return err; return err;
memcpy(new, s, len); memcpy(new, s, len);
return (new - strtab); return (new - strtab);
} }
int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size) int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
{ {
struct fdt_reserve_entry *re; struct fdt_reserve_entry *re;
int err; int err;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt)); re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
err = _fdt_splice_mem_rsv(fdt, re, 0, 1); err = _fdt_splice_mem_rsv(fdt, re, 0, 1);
if (err) if (err)
return err; return err;
re->address = cpu_to_fdt64(address); re->address = cpu_to_fdt64(address);
re->size = cpu_to_fdt64(size); re->size = cpu_to_fdt64(size);
return 0; return 0;
} }
int fdt_del_mem_rsv(void *fdt, int n) int fdt_del_mem_rsv(void *fdt, int n)
{ {
struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n); struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
if (n >= fdt_num_mem_rsv(fdt)) if (n >= fdt_num_mem_rsv(fdt))
return -FDT_ERR_NOTFOUND; return -FDT_ERR_NOTFOUND;
return _fdt_splice_mem_rsv(fdt, re, 1, 0); return _fdt_splice_mem_rsv(fdt, re, 1, 0);
} }
static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name, static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
int len, struct fdt_property **prop) int len, struct fdt_property **prop)
{ {
int oldlen; int oldlen;
int err; int err;
*prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen); *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
if (! (*prop)) if (! (*prop))
return oldlen; return oldlen;
if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen), if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
FDT_TAGALIGN(len)))) FDT_TAGALIGN(len))))
return err; return err;
(*prop)->len = cpu_to_fdt32(len); (*prop)->len = cpu_to_fdt32(len);
return 0; return 0;
} }
static int _fdt_add_property(void *fdt, int nodeoffset, const char *name, static int _fdt_add_property(void *fdt, int nodeoffset, const char *name,
int len, struct fdt_property **prop) int len, struct fdt_property **prop)
{ {
int proplen; int proplen;
int nextoffset; int nextoffset;
int namestroff; int namestroff;
int err; int err;
if ((nextoffset = _fdt_check_node_offset(fdt, nodeoffset)) < 0) if ((nextoffset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
return nextoffset; return nextoffset;
namestroff = _fdt_find_add_string(fdt, name); namestroff = _fdt_find_add_string(fdt, name);
if (namestroff < 0) if (namestroff < 0)
return namestroff; return namestroff;
*prop = _fdt_offset_ptr_w(fdt, nextoffset); *prop = _fdt_offset_ptr_w(fdt, nextoffset);
proplen = sizeof(**prop) + FDT_TAGALIGN(len); proplen = sizeof(**prop) + FDT_TAGALIGN(len);
err = _fdt_splice_struct(fdt, *prop, 0, proplen); err = _fdt_splice_struct(fdt, *prop, 0, proplen);
if (err) if (err)
return err; return err;
(*prop)->tag = cpu_to_fdt32(FDT_PROP); (*prop)->tag = cpu_to_fdt32(FDT_PROP);
(*prop)->nameoff = cpu_to_fdt32(namestroff); (*prop)->nameoff = cpu_to_fdt32(namestroff);
(*prop)->len = cpu_to_fdt32(len); (*prop)->len = cpu_to_fdt32(len);
return 0; return 0;
} }
int fdt_set_name(void *fdt, int nodeoffset, const char *name) int fdt_set_name(void *fdt, int nodeoffset, const char *name)
{ {
char *namep; char *namep;
int oldlen, newlen; int oldlen, newlen;
int err; int err;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen); namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen);
if (!namep) if (!namep)
return oldlen; return oldlen;
newlen = strlen(name); newlen = strlen(name);
err = _fdt_splice_struct(fdt, namep, FDT_TAGALIGN(oldlen+1), err = _fdt_splice_struct(fdt, namep, FDT_TAGALIGN(oldlen+1),
FDT_TAGALIGN(newlen+1)); FDT_TAGALIGN(newlen+1));
if (err) if (err)
return err; return err;
memcpy(namep, name, newlen+1); memcpy(namep, name, newlen+1);
return 0; return 0;
} }
int fdt_setprop(void *fdt, int nodeoffset, const char *name, int fdt_setprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len) const void *val, int len)
{ {
struct fdt_property *prop; struct fdt_property *prop;
int err; int err;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
err = _fdt_resize_property(fdt, nodeoffset, name, len, &prop); err = _fdt_resize_property(fdt, nodeoffset, name, len, &prop);
if (err == -FDT_ERR_NOTFOUND) if (err == -FDT_ERR_NOTFOUND)
err = _fdt_add_property(fdt, nodeoffset, name, len, &prop); err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
if (err) if (err)
return err; return err;
if (len) if (len)
memcpy(prop->data, val, len); memcpy(prop->data, val, len);
return 0; return 0;
} }
int fdt_appendprop(void *fdt, int nodeoffset, const char *name, int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len) const void *val, int len)
{ {
struct fdt_property *prop; struct fdt_property *prop;
int err, oldlen, newlen; int err, oldlen, newlen;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen); prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
if (prop) { if (prop) {
newlen = len + oldlen; newlen = len + oldlen;
err = _fdt_splice_struct(fdt, prop->data, err = _fdt_splice_struct(fdt, prop->data,
FDT_TAGALIGN(oldlen), FDT_TAGALIGN(oldlen),
FDT_TAGALIGN(newlen)); FDT_TAGALIGN(newlen));
if (err) if (err)
return err; return err;
prop->len = cpu_to_fdt32(newlen); prop->len = cpu_to_fdt32(newlen);
memcpy(prop->data + oldlen, val, len); memcpy(prop->data + oldlen, val, len);
} else { } else {
err = _fdt_add_property(fdt, nodeoffset, name, len, &prop); err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
if (err) if (err)
return err; return err;
memcpy(prop->data, val, len); memcpy(prop->data, val, len);
} }
return 0; return 0;
} }
int fdt_delprop(void *fdt, int nodeoffset, const char *name) int fdt_delprop(void *fdt, int nodeoffset, const char *name)
{ {
struct fdt_property *prop; struct fdt_property *prop;
int len, proplen; int len, proplen;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
prop = fdt_get_property_w(fdt, nodeoffset, name, &len); prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
if (! prop) if (! prop)
return len; return len;
proplen = sizeof(*prop) + FDT_TAGALIGN(len); proplen = sizeof(*prop) + FDT_TAGALIGN(len);
return _fdt_splice_struct(fdt, prop, proplen, 0); return _fdt_splice_struct(fdt, prop, proplen, 0);
} }
int fdt_add_subnode_namelen(void *fdt, int parentoffset, int fdt_add_subnode_namelen(void *fdt, int parentoffset,
const char *name, int namelen) const char *name, int namelen)
{ {
struct fdt_node_header *nh; struct fdt_node_header *nh;
int offset, nextoffset; int offset, nextoffset;
int nodelen; int nodelen;
int err; int err;
uint32_t tag; uint32_t tag;
fdt32_t *endtag; fdt32_t *endtag;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen); offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
if (offset >= 0) if (offset >= 0)
return -FDT_ERR_EXISTS; return -FDT_ERR_EXISTS;
else if (offset != -FDT_ERR_NOTFOUND) else if (offset != -FDT_ERR_NOTFOUND)
return offset; return offset;
/* Try to place the new node after the parent's properties */ /* Try to place the new node after the parent's properties */
fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */ fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
do { do {
offset = nextoffset; offset = nextoffset;
tag = fdt_next_tag(fdt, offset, &nextoffset); tag = fdt_next_tag(fdt, offset, &nextoffset);
} while ((tag == FDT_PROP) || (tag == FDT_NOP)); } while ((tag == FDT_PROP) || (tag == FDT_NOP));
nh = _fdt_offset_ptr_w(fdt, offset); nh = _fdt_offset_ptr_w(fdt, offset);
nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE; nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
err = _fdt_splice_struct(fdt, nh, 0, nodelen); err = _fdt_splice_struct(fdt, nh, 0, nodelen);
if (err) if (err)
return err; return err;
nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE); nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
memset(nh->name, 0, FDT_TAGALIGN(namelen+1)); memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
memcpy(nh->name, name, namelen); memcpy(nh->name, name, namelen);
endtag = (fdt32_t *)((char *)nh + nodelen - FDT_TAGSIZE); endtag = (fdt32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
*endtag = cpu_to_fdt32(FDT_END_NODE); *endtag = cpu_to_fdt32(FDT_END_NODE);
return offset; return offset;
} }
int fdt_add_subnode(void *fdt, int parentoffset, const char *name) int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
{ {
return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name)); return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
} }
int fdt_del_node(void *fdt, int nodeoffset) int fdt_del_node(void *fdt, int nodeoffset)
{ {
int endoffset; int endoffset;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
endoffset = _fdt_node_end_offset(fdt, nodeoffset); endoffset = _fdt_node_end_offset(fdt, nodeoffset);
if (endoffset < 0) if (endoffset < 0)
return endoffset; return endoffset;
return _fdt_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset), return _fdt_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
endoffset - nodeoffset, 0); endoffset - nodeoffset, 0);
} }
static void _fdt_packblocks(const char *old, char *new, static void _fdt_packblocks(const char *old, char *new,
int mem_rsv_size, int struct_size) int mem_rsv_size, int struct_size)
{ {
int mem_rsv_off, struct_off, strings_off; int mem_rsv_off, struct_off, strings_off;
mem_rsv_off = FDT_ALIGN(sizeof(struct fdt_header), 8); mem_rsv_off = FDT_ALIGN(sizeof(struct fdt_header), 8);
struct_off = mem_rsv_off + mem_rsv_size; struct_off = mem_rsv_off + mem_rsv_size;
strings_off = struct_off + struct_size; strings_off = struct_off + struct_size;
memmove(new + mem_rsv_off, old + fdt_off_mem_rsvmap(old), mem_rsv_size); memmove(new + mem_rsv_off, old + fdt_off_mem_rsvmap(old), mem_rsv_size);
fdt_set_off_mem_rsvmap(new, mem_rsv_off); fdt_set_off_mem_rsvmap(new, mem_rsv_off);
memmove(new + struct_off, old + fdt_off_dt_struct(old), struct_size); memmove(new + struct_off, old + fdt_off_dt_struct(old), struct_size);
fdt_set_off_dt_struct(new, struct_off); fdt_set_off_dt_struct(new, struct_off);
fdt_set_size_dt_struct(new, struct_size); fdt_set_size_dt_struct(new, struct_size);
memmove(new + strings_off, old + fdt_off_dt_strings(old), memmove(new + strings_off, old + fdt_off_dt_strings(old),
fdt_size_dt_strings(old)); fdt_size_dt_strings(old));
fdt_set_off_dt_strings(new, strings_off); fdt_set_off_dt_strings(new, strings_off);
fdt_set_size_dt_strings(new, fdt_size_dt_strings(old)); fdt_set_size_dt_strings(new, fdt_size_dt_strings(old));
} }
int fdt_open_into(const void *fdt, void *buf, int bufsize) int fdt_open_into(const void *fdt, void *buf, int bufsize)
{ {
int err; int err;
int mem_rsv_size, struct_size; int mem_rsv_size, struct_size;
int newsize; int newsize;
const char *fdtstart = fdt; const char *fdtstart = fdt;
const char *fdtend = fdtstart + fdt_totalsize(fdt); const char *fdtend = fdtstart + fdt_totalsize(fdt);
char *tmp; char *tmp;
FDT_CHECK_HEADER(fdt); FDT_CHECK_HEADER(fdt);
mem_rsv_size = (fdt_num_mem_rsv(fdt)+1) mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
* sizeof(struct fdt_reserve_entry); * sizeof(struct fdt_reserve_entry);
if (fdt_version(fdt) >= 17) { if (fdt_version(fdt) >= 17) {
struct_size = fdt_size_dt_struct(fdt); struct_size = fdt_size_dt_struct(fdt);
} else { } else {
struct_size = 0; struct_size = 0;
while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END) while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
; ;
if (struct_size < 0) if (struct_size < 0)
return struct_size; return struct_size;
} }
if (!_fdt_blocks_misordered(fdt, mem_rsv_size, struct_size)) { if (!_fdt_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
/* no further work necessary */ /* no further work necessary */
err = fdt_move(fdt, buf, bufsize); err = fdt_move(fdt, buf, bufsize);
if (err) if (err)
return err; return err;
fdt_set_version(buf, 17); fdt_set_version(buf, 17);
fdt_set_size_dt_struct(buf, struct_size); fdt_set_size_dt_struct(buf, struct_size);
fdt_set_totalsize(buf, bufsize); fdt_set_totalsize(buf, bufsize);
return 0; return 0;
} }
/* Need to reorder */ /* Need to reorder */
newsize = FDT_ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size newsize = FDT_ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
+ struct_size + fdt_size_dt_strings(fdt); + struct_size + fdt_size_dt_strings(fdt);
if (bufsize < newsize) if (bufsize < newsize)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
/* First attempt to build converted tree at beginning of buffer */ /* First attempt to build converted tree at beginning of buffer */
tmp = buf; tmp = buf;
/* But if that overlaps with the old tree... */ /* But if that overlaps with the old tree... */
if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) { if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) {
/* Try right after the old tree instead */ /* Try right after the old tree instead */
tmp = (char *)(uintptr_t)fdtend; tmp = (char *)(uintptr_t)fdtend;
if ((tmp + newsize) > ((char *)buf + bufsize)) if ((tmp + newsize) > ((char *)buf + bufsize))
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
} }
_fdt_packblocks(fdt, tmp, mem_rsv_size, struct_size); _fdt_packblocks(fdt, tmp, mem_rsv_size, struct_size);
memmove(buf, tmp, newsize); memmove(buf, tmp, newsize);
fdt_set_magic(buf, FDT_MAGIC); fdt_set_magic(buf, FDT_MAGIC);
fdt_set_totalsize(buf, bufsize); fdt_set_totalsize(buf, bufsize);
fdt_set_version(buf, 17); fdt_set_version(buf, 17);
fdt_set_last_comp_version(buf, 16); fdt_set_last_comp_version(buf, 16);
fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt)); fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
return 0; return 0;
} }
int fdt_pack(void *fdt) int fdt_pack(void *fdt)
{ {
int mem_rsv_size; int mem_rsv_size;
FDT_RW_CHECK_HEADER(fdt); FDT_RW_CHECK_HEADER(fdt);
mem_rsv_size = (fdt_num_mem_rsv(fdt)+1) mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
* sizeof(struct fdt_reserve_entry); * sizeof(struct fdt_reserve_entry);
_fdt_packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt)); _fdt_packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
fdt_set_totalsize(fdt, _fdt_data_size(fdt)); fdt_set_totalsize(fdt, _fdt_data_size(fdt));
return 0; return 0;
} }

View File

@ -54,47 +54,47 @@
#include "libfdt_internal.h" #include "libfdt_internal.h"
struct fdt_errtabent { struct fdt_errtabent {
const char *str; const char *str;
}; };
#define FDT_ERRTABENT(val) \ #define FDT_ERRTABENT(val) \
[(val)] = { .str = #val, } [(val)] = { .str = #val, }
static struct fdt_errtabent fdt_errtable[] = { static struct fdt_errtabent fdt_errtable[] = {
FDT_ERRTABENT(FDT_ERR_NOTFOUND), FDT_ERRTABENT(FDT_ERR_NOTFOUND),
FDT_ERRTABENT(FDT_ERR_EXISTS), FDT_ERRTABENT(FDT_ERR_EXISTS),
FDT_ERRTABENT(FDT_ERR_NOSPACE), FDT_ERRTABENT(FDT_ERR_NOSPACE),
FDT_ERRTABENT(FDT_ERR_BADOFFSET), FDT_ERRTABENT(FDT_ERR_BADOFFSET),
FDT_ERRTABENT(FDT_ERR_BADPATH), FDT_ERRTABENT(FDT_ERR_BADPATH),
FDT_ERRTABENT(FDT_ERR_BADPHANDLE), FDT_ERRTABENT(FDT_ERR_BADPHANDLE),
FDT_ERRTABENT(FDT_ERR_BADSTATE), FDT_ERRTABENT(FDT_ERR_BADSTATE),
FDT_ERRTABENT(FDT_ERR_TRUNCATED), FDT_ERRTABENT(FDT_ERR_TRUNCATED),
FDT_ERRTABENT(FDT_ERR_BADMAGIC), FDT_ERRTABENT(FDT_ERR_BADMAGIC),
FDT_ERRTABENT(FDT_ERR_BADVERSION), FDT_ERRTABENT(FDT_ERR_BADVERSION),
FDT_ERRTABENT(FDT_ERR_BADSTRUCTURE), FDT_ERRTABENT(FDT_ERR_BADSTRUCTURE),
FDT_ERRTABENT(FDT_ERR_BADLAYOUT), FDT_ERRTABENT(FDT_ERR_BADLAYOUT),
FDT_ERRTABENT(FDT_ERR_INTERNAL), FDT_ERRTABENT(FDT_ERR_INTERNAL),
FDT_ERRTABENT(FDT_ERR_BADNCELLS), FDT_ERRTABENT(FDT_ERR_BADNCELLS),
FDT_ERRTABENT(FDT_ERR_BADVALUE), FDT_ERRTABENT(FDT_ERR_BADVALUE),
FDT_ERRTABENT(FDT_ERR_BADOVERLAY), FDT_ERRTABENT(FDT_ERR_BADOVERLAY),
FDT_ERRTABENT(FDT_ERR_NOPHANDLES), FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
}; };
#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0])) #define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
const char *fdt_strerror(int errval) const char *fdt_strerror(int errval)
{ {
if (errval > 0) if (errval > 0)
return "<valid offset/length>"; return "<valid offset/length>";
else if (errval == 0) else if (errval == 0)
return "<no error>"; return "<no error>";
else if (errval > -FDT_ERRTABSIZE) { else if (errval > -FDT_ERRTABSIZE) {
const char *s = fdt_errtable[-errval].str; const char *s = fdt_errtable[-errval].str;
if (s) if (s)
return s; return s;
} }
return "<unknown error>"; return "<unknown error>";
} }

View File

@ -55,232 +55,232 @@
static int _fdt_sw_check_header(void *fdt) static int _fdt_sw_check_header(void *fdt)
{ {
if (fdt_magic(fdt) != FDT_SW_MAGIC) if (fdt_magic(fdt) != FDT_SW_MAGIC)
return -FDT_ERR_BADMAGIC; return -FDT_ERR_BADMAGIC;
/* FIXME: should check more details about the header state */ /* FIXME: should check more details about the header state */
return 0; return 0;
} }
#define FDT_SW_CHECK_HEADER(fdt) \ #define FDT_SW_CHECK_HEADER(fdt) \
{ \ { \
int err; \ int err; \
if ((err = _fdt_sw_check_header(fdt)) != 0) \ if ((err = _fdt_sw_check_header(fdt)) != 0) \
return err; \ return err; \
} }
static void *_fdt_grab_space(void *fdt, size_t len) static void *_fdt_grab_space(void *fdt, size_t len)
{ {
int offset = fdt_size_dt_struct(fdt); int offset = fdt_size_dt_struct(fdt);
int spaceleft; int spaceleft;
spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt) spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
- fdt_size_dt_strings(fdt); - fdt_size_dt_strings(fdt);
if ((offset + len < offset) || (offset + len > spaceleft)) if ((offset + len < offset) || (offset + len > spaceleft))
return NULL; return NULL;
fdt_set_size_dt_struct(fdt, offset + len); fdt_set_size_dt_struct(fdt, offset + len);
return _fdt_offset_ptr_w(fdt, offset); return _fdt_offset_ptr_w(fdt, offset);
} }
int fdt_create(void *buf, int bufsize) int fdt_create(void *buf, int bufsize)
{ {
void *fdt = buf; void *fdt = buf;
if (bufsize < sizeof(struct fdt_header)) if (bufsize < sizeof(struct fdt_header))
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
memset(buf, 0, bufsize); memset(buf, 0, bufsize);
fdt_set_magic(fdt, FDT_SW_MAGIC); fdt_set_magic(fdt, FDT_SW_MAGIC);
fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION); fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION); fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
fdt_set_totalsize(fdt, bufsize); fdt_set_totalsize(fdt, bufsize);
fdt_set_off_mem_rsvmap(fdt, FDT_ALIGN(sizeof(struct fdt_header), fdt_set_off_mem_rsvmap(fdt, FDT_ALIGN(sizeof(struct fdt_header),
sizeof(struct fdt_reserve_entry))); sizeof(struct fdt_reserve_entry)));
fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt)); fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
fdt_set_off_dt_strings(fdt, bufsize); fdt_set_off_dt_strings(fdt, bufsize);
return 0; return 0;
} }
int fdt_resize(void *fdt, void *buf, int bufsize) int fdt_resize(void *fdt, void *buf, int bufsize)
{ {
size_t headsize, tailsize; size_t headsize, tailsize;
char *oldtail, *newtail; char *oldtail, *newtail;
FDT_SW_CHECK_HEADER(fdt); FDT_SW_CHECK_HEADER(fdt);
headsize = fdt_off_dt_struct(fdt); headsize = fdt_off_dt_struct(fdt);
tailsize = fdt_size_dt_strings(fdt); tailsize = fdt_size_dt_strings(fdt);
if ((headsize + tailsize) > bufsize) if ((headsize + tailsize) > bufsize)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
oldtail = (char *)fdt + fdt_totalsize(fdt) - tailsize; oldtail = (char *)fdt + fdt_totalsize(fdt) - tailsize;
newtail = (char *)buf + bufsize - tailsize; newtail = (char *)buf + bufsize - tailsize;
/* Two cases to avoid clobbering data if the old and new /* Two cases to avoid clobbering data if the old and new
* buffers partially overlap */ * buffers partially overlap */
if (buf <= fdt) { if (buf <= fdt) {
memmove(buf, fdt, headsize); memmove(buf, fdt, headsize);
memmove(newtail, oldtail, tailsize); memmove(newtail, oldtail, tailsize);
} else { } else {
memmove(newtail, oldtail, tailsize); memmove(newtail, oldtail, tailsize);
memmove(buf, fdt, headsize); memmove(buf, fdt, headsize);
} }
fdt_set_off_dt_strings(buf, bufsize); fdt_set_off_dt_strings(buf, bufsize);
fdt_set_totalsize(buf, bufsize); fdt_set_totalsize(buf, bufsize);
return 0; return 0;
} }
int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size) int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
{ {
struct fdt_reserve_entry *re; struct fdt_reserve_entry *re;
int offset; int offset;
FDT_SW_CHECK_HEADER(fdt); FDT_SW_CHECK_HEADER(fdt);
if (fdt_size_dt_struct(fdt)) if (fdt_size_dt_struct(fdt))
return -FDT_ERR_BADSTATE; return -FDT_ERR_BADSTATE;
offset = fdt_off_dt_struct(fdt); offset = fdt_off_dt_struct(fdt);
if ((offset + sizeof(*re)) > fdt_totalsize(fdt)) if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
re = (struct fdt_reserve_entry *)((char *)fdt + offset); re = (struct fdt_reserve_entry *)((char *)fdt + offset);
re->address = cpu_to_fdt64(addr); re->address = cpu_to_fdt64(addr);
re->size = cpu_to_fdt64(size); re->size = cpu_to_fdt64(size);
fdt_set_off_dt_struct(fdt, offset + sizeof(*re)); fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
return 0; return 0;
} }
int fdt_finish_reservemap(void *fdt) int fdt_finish_reservemap(void *fdt)
{ {
return fdt_add_reservemap_entry(fdt, 0, 0); return fdt_add_reservemap_entry(fdt, 0, 0);
} }
int fdt_begin_node(void *fdt, const char *name) int fdt_begin_node(void *fdt, const char *name)
{ {
struct fdt_node_header *nh; struct fdt_node_header *nh;
int namelen = strlen(name) + 1; int namelen = strlen(name) + 1;
FDT_SW_CHECK_HEADER(fdt); FDT_SW_CHECK_HEADER(fdt);
nh = _fdt_grab_space(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen)); nh = _fdt_grab_space(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
if (! nh) if (! nh)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE); nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
memcpy(nh->name, name, namelen); memcpy(nh->name, name, namelen);
return 0; return 0;
} }
int fdt_end_node(void *fdt) int fdt_end_node(void *fdt)
{ {
fdt32_t *en; fdt32_t *en;
FDT_SW_CHECK_HEADER(fdt); FDT_SW_CHECK_HEADER(fdt);
en = _fdt_grab_space(fdt, FDT_TAGSIZE); en = _fdt_grab_space(fdt, FDT_TAGSIZE);
if (! en) if (! en)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
*en = cpu_to_fdt32(FDT_END_NODE); *en = cpu_to_fdt32(FDT_END_NODE);
return 0; return 0;
} }
static int _fdt_find_add_string(void *fdt, const char *s) static int _fdt_find_add_string(void *fdt, const char *s)
{ {
char *strtab = (char *)fdt + fdt_totalsize(fdt); char *strtab = (char *)fdt + fdt_totalsize(fdt);
const char *p; const char *p;
int strtabsize = fdt_size_dt_strings(fdt); int strtabsize = fdt_size_dt_strings(fdt);
int len = strlen(s) + 1; int len = strlen(s) + 1;
int struct_top, offset; int struct_top, offset;
p = _fdt_find_string(strtab - strtabsize, strtabsize, s); p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
if (p) if (p)
return p - strtab; return p - strtab;
/* Add it */ /* Add it */
offset = -strtabsize - len; offset = -strtabsize - len;
struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt); struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
if (fdt_totalsize(fdt) + offset < struct_top) if (fdt_totalsize(fdt) + offset < struct_top)
return 0; /* no more room :( */ return 0; /* no more room :( */
memcpy(strtab + offset, s, len); memcpy(strtab + offset, s, len);
fdt_set_size_dt_strings(fdt, strtabsize + len); fdt_set_size_dt_strings(fdt, strtabsize + len);
return offset; return offset;
} }
int fdt_property(void *fdt, const char *name, const void *val, int len) int fdt_property(void *fdt, const char *name, const void *val, int len)
{ {
struct fdt_property *prop; struct fdt_property *prop;
int nameoff; int nameoff;
FDT_SW_CHECK_HEADER(fdt); FDT_SW_CHECK_HEADER(fdt);
nameoff = _fdt_find_add_string(fdt, name); nameoff = _fdt_find_add_string(fdt, name);
if (nameoff == 0) if (nameoff == 0)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len)); prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
if (! prop) if (! prop)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
prop->tag = cpu_to_fdt32(FDT_PROP); prop->tag = cpu_to_fdt32(FDT_PROP);
prop->nameoff = cpu_to_fdt32(nameoff); prop->nameoff = cpu_to_fdt32(nameoff);
prop->len = cpu_to_fdt32(len); prop->len = cpu_to_fdt32(len);
memcpy(prop->data, val, len); memcpy(prop->data, val, len);
return 0; return 0;
} }
int fdt_finish(void *fdt) int fdt_finish(void *fdt)
{ {
char *p = (char *)fdt; char *p = (char *)fdt;
fdt32_t *end; fdt32_t *end;
int oldstroffset, newstroffset; int oldstroffset, newstroffset;
uint32_t tag; uint32_t tag;
int offset, nextoffset; int offset, nextoffset;
FDT_SW_CHECK_HEADER(fdt); FDT_SW_CHECK_HEADER(fdt);
/* Add terminator */ /* Add terminator */
end = _fdt_grab_space(fdt, sizeof(*end)); end = _fdt_grab_space(fdt, sizeof(*end));
if (! end) if (! end)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
*end = cpu_to_fdt32(FDT_END); *end = cpu_to_fdt32(FDT_END);
/* Relocate the string table */ /* Relocate the string table */
oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt); oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt); newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt)); memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
fdt_set_off_dt_strings(fdt, newstroffset); fdt_set_off_dt_strings(fdt, newstroffset);
/* Walk the structure, correcting string offsets */ /* Walk the structure, correcting string offsets */
offset = 0; offset = 0;
while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) { while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
if (tag == FDT_PROP) { if (tag == FDT_PROP) {
struct fdt_property *prop = struct fdt_property *prop =
_fdt_offset_ptr_w(fdt, offset); _fdt_offset_ptr_w(fdt, offset);
int nameoff; int nameoff;
nameoff = fdt32_to_cpu(prop->nameoff); nameoff = fdt32_to_cpu(prop->nameoff);
nameoff += fdt_size_dt_strings(fdt); nameoff += fdt_size_dt_strings(fdt);
prop->nameoff = cpu_to_fdt32(nameoff); prop->nameoff = cpu_to_fdt32(nameoff);
} }
offset = nextoffset; offset = nextoffset;
} }
if (nextoffset < 0) if (nextoffset < 0)
return nextoffset; return nextoffset;
/* Finally, adjust the header */ /* Finally, adjust the header */
fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt)); fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
fdt_set_magic(fdt, FDT_MAGIC); fdt_set_magic(fdt, FDT_MAGIC);
return 0; return 0;
} }

View File

@ -54,84 +54,84 @@
#include "libfdt_internal.h" #include "libfdt_internal.h"
int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
const char *name, int namelen, const char *name, int namelen,
uint32_t idx, const void *val, uint32_t idx, const void *val,
int len) int len)
{ {
void *propval; void *propval;
int proplen; int proplen;
propval = fdt_getprop_namelen_w(fdt, nodeoffset, name, namelen, propval = fdt_getprop_namelen_w(fdt, nodeoffset, name, namelen,
&proplen); &proplen);
if (!propval) if (!propval)
return proplen; return proplen;
if (proplen < (len + idx)) if (proplen < (len + idx))
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
memcpy((char *)propval + idx, val, len); memcpy((char *)propval + idx, val, len);
return 0; return 0;
} }
int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
const void *val, int len) const void *val, int len)
{ {
const void *propval; const void *propval;
int proplen; int proplen;
propval = fdt_getprop(fdt, nodeoffset, name, &proplen); propval = fdt_getprop(fdt, nodeoffset, name, &proplen);
if (! propval) if (! propval)
return proplen; return proplen;
if (proplen != len) if (proplen != len)
return -FDT_ERR_NOSPACE; return -FDT_ERR_NOSPACE;
return fdt_setprop_inplace_namelen_partial(fdt, nodeoffset, name, return fdt_setprop_inplace_namelen_partial(fdt, nodeoffset, name,
strlen(name), 0, strlen(name), 0,
val, len); val, len);
} }
static void _fdt_nop_region(void *start, int len) static void _fdt_nop_region(void *start, int len)
{ {
fdt32_t *p; fdt32_t *p;
for (p = start; (char *)p < ((char *)start + len); p++) for (p = start; (char *)p < ((char *)start + len); p++)
*p = cpu_to_fdt32(FDT_NOP); *p = cpu_to_fdt32(FDT_NOP);
} }
int fdt_nop_property(void *fdt, int nodeoffset, const char *name) int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
{ {
struct fdt_property *prop; struct fdt_property *prop;
int len; int len;
prop = fdt_get_property_w(fdt, nodeoffset, name, &len); prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
if (! prop) if (! prop)
return len; return len;
_fdt_nop_region(prop, len + sizeof(*prop)); _fdt_nop_region(prop, len + sizeof(*prop));
return 0; return 0;
} }
int _fdt_node_end_offset(void *fdt, int offset) int _fdt_node_end_offset(void *fdt, int offset)
{ {
int depth = 0; int depth = 0;
while ((offset >= 0) && (depth >= 0)) while ((offset >= 0) && (depth >= 0))
offset = fdt_next_node(fdt, offset, &depth); offset = fdt_next_node(fdt, offset, &depth);
return offset; return offset;
} }
int fdt_nop_node(void *fdt, int nodeoffset) int fdt_nop_node(void *fdt, int nodeoffset)
{ {
int endoffset; int endoffset;
endoffset = _fdt_node_end_offset(fdt, nodeoffset); endoffset = _fdt_node_end_offset(fdt, nodeoffset);
if (endoffset < 0) if (endoffset < 0)
return endoffset; return endoffset;
_fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), _fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0),
endoffset - nodeoffset); endoffset - nodeoffset);
return 0; return 0;
} }

View File

@ -70,40 +70,40 @@ typedef uint32_t FDT_BITWISE fdt32_t;
typedef uint64_t FDT_BITWISE fdt64_t; typedef uint64_t FDT_BITWISE fdt64_t;
typedef uint64_t unaligned_fdt64_t __attribute__((aligned(4))); typedef uint64_t unaligned_fdt64_t __attribute__((aligned(4)));
#define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *)&x)[n]) #define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *)&x)[n])
#define CPU_TO_FDT16(x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1)) #define CPU_TO_FDT16(x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1))
#define CPU_TO_FDT32(x) ((EXTRACT_BYTE(x, 0) << 24) | (EXTRACT_BYTE(x, 1) << 16) | \ #define CPU_TO_FDT32(x) ((EXTRACT_BYTE(x, 0) << 24) | (EXTRACT_BYTE(x, 1) << 16) | \
(EXTRACT_BYTE(x, 2) << 8) | EXTRACT_BYTE(x, 3)) (EXTRACT_BYTE(x, 2) << 8) | EXTRACT_BYTE(x, 3))
#define CPU_TO_FDT64(x) ((EXTRACT_BYTE(x, 0) << 56) | (EXTRACT_BYTE(x, 1) << 48) | \ #define CPU_TO_FDT64(x) ((EXTRACT_BYTE(x, 0) << 56) | (EXTRACT_BYTE(x, 1) << 48) | \
(EXTRACT_BYTE(x, 2) << 40) | (EXTRACT_BYTE(x, 3) << 32) | \ (EXTRACT_BYTE(x, 2) << 40) | (EXTRACT_BYTE(x, 3) << 32) | \
(EXTRACT_BYTE(x, 4) << 24) | (EXTRACT_BYTE(x, 5) << 16) | \ (EXTRACT_BYTE(x, 4) << 24) | (EXTRACT_BYTE(x, 5) << 16) | \
(EXTRACT_BYTE(x, 6) << 8) | EXTRACT_BYTE(x, 7)) (EXTRACT_BYTE(x, 6) << 8) | EXTRACT_BYTE(x, 7))
static inline uint16_t fdt16_to_cpu(fdt16_t x) static inline uint16_t fdt16_to_cpu(fdt16_t x)
{ {
return (FDT_FORCE uint16_t)CPU_TO_FDT16(x); return (FDT_FORCE uint16_t)CPU_TO_FDT16(x);
} }
static inline fdt16_t cpu_to_fdt16(uint16_t x) static inline fdt16_t cpu_to_fdt16(uint16_t x)
{ {
return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x); return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x);
} }
static inline uint32_t fdt32_to_cpu(fdt32_t x) static inline uint32_t fdt32_to_cpu(fdt32_t x)
{ {
return (FDT_FORCE uint32_t)CPU_TO_FDT32(x); return (FDT_FORCE uint32_t)CPU_TO_FDT32(x);
} }
static inline fdt32_t cpu_to_fdt32(uint32_t x) static inline fdt32_t cpu_to_fdt32(uint32_t x)
{ {
return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x); return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x);
} }
static inline uint64_t fdt64_to_cpu(fdt64_t x) static inline uint64_t fdt64_to_cpu(fdt64_t x)
{ {
return (FDT_FORCE uint64_t)CPU_TO_FDT64(x); return (FDT_FORCE uint64_t)CPU_TO_FDT64(x);
} }
static inline fdt64_t cpu_to_fdt64(uint64_t x) static inline fdt64_t cpu_to_fdt64(uint64_t x)
{ {
return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x); return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x);
} }
#undef CPU_TO_FDT64 #undef CPU_TO_FDT64
#undef CPU_TO_FDT32 #undef CPU_TO_FDT32

View File

@ -52,15 +52,15 @@
*/ */
#include "fdt.h" #include "fdt.h"
#define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
#define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE)) #define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE))
#define FDT_CHECK_HEADER(fdt) \ #define FDT_CHECK_HEADER(fdt) \
{ \ { \
int __err; \ int __err; \
if ((__err = fdt_check_header(fdt)) != 0) \ if ((__err = fdt_check_header(fdt)) != 0) \
return __err; \ return __err; \
} }
int _fdt_check_node_offset(const void *fdt, int offset); int _fdt_check_node_offset(const void *fdt, int offset);
int _fdt_check_prop_offset(const void *fdt, int offset); int _fdt_check_prop_offset(const void *fdt, int offset);
@ -69,27 +69,27 @@ int _fdt_node_end_offset(void *fdt, int nodeoffset);
static inline const void *_fdt_offset_ptr(const void *fdt, int offset) static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
{ {
return (const char *)fdt + fdt_off_dt_struct(fdt) + offset; return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
} }
static inline void *_fdt_offset_ptr_w(void *fdt, int offset) static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
{ {
return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset); return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset);
} }
static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n) static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
{ {
const struct fdt_reserve_entry *rsv_table = const struct fdt_reserve_entry *rsv_table =
(const struct fdt_reserve_entry *) (const struct fdt_reserve_entry *)
((const char *)fdt + fdt_off_mem_rsvmap(fdt)); ((const char *)fdt + fdt_off_mem_rsvmap(fdt));
return rsv_table + n; return rsv_table + n;
} }
static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n) static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
{ {
return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n); return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n);
} }
#define FDT_SW_MAGIC (~FDT_MAGIC) #define FDT_SW_MAGIC (~FDT_MAGIC)
#endif /* _LIBFDT_INTERNAL_H */ #endif /* _LIBFDT_INTERNAL_H */

View File

@ -213,16 +213,16 @@ int dtb_node_get_addr_and_size_by_index(const struct dtb_node *node, int index,
int onesize, na, ns; int onesize, na, ns;
na = dtb_node_n_addr_cells(node); na = dtb_node_n_addr_cells(node);
ns = dtb_node_n_size_cells(node); ns = dtb_node_n_size_cells(node);
prop = dtb_node_get_dtb_node_property_value(node, "reg", &psize); prop = dtb_node_get_dtb_node_property_value(node, "reg", &psize);
if (prop == NULL) if (prop == NULL)
{ {
return -1; return -1;
} }
psize /= 4; psize /= 4;
onesize = na + ns; onesize = na + ns;
if (psize >= (index + 1) * onesize) if (psize >= (index + 1) * onesize)
{ {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -38,4 +38,4 @@ int device_tree_setup(void *mem_addr)
} }
return -1; return -1;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
@ -103,7 +103,7 @@ struct fb_fix_screeninfo
/* (physical address) */ /* (physical address) */
uint32_t mmio_len; /* Length of Memory Mapped I/O */ uint32_t mmio_len; /* Length of Memory Mapped I/O */
uint32_t accel; /* Indicate to driver which */ uint32_t accel; /* Indicate to driver which */
/* specific chip/card we have */ /* specific chip/card we have */
uint16_t capabilities; /* see FB_CAP_* */ uint16_t capabilities; /* see FB_CAP_* */
uint16_t reserved[2]; /* Reserved for future compatibility */ uint16_t reserved[2]; /* Reserved for future compatibility */
}; };

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * COPYRIGHT (C) 2011-2023, Real-Thread Information Technology Ltd
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2022, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2023, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

Some files were not shown because too many files have changed in this diff Show More