Skip to content

Commit

Permalink
Testing some speed / size optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
jnettlet committed Oct 29, 2024
1 parent 22b6f7d commit 73277c3
Show file tree
Hide file tree
Showing 4 changed files with 349 additions and 17 deletions.
6 changes: 3 additions & 3 deletions emmc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void InitMmcPinFunction(void);
* @retval EMMC_SUCCESS successful.
* @retval EMMC_ERR error from interrupt API.
*/
EMMC_ERROR_CODE emmc_init(uint8_t low_clock_mode_enable)
EMMC_ERROR_CODE __attribute__((optimize("O0"))) emmc_init(uint8_t low_clock_mode_enable)
{
EMMC_ERROR_CODE retult;

Expand Down Expand Up @@ -86,7 +86,7 @@ EMMC_ERROR_CODE emmc_init(uint8_t low_clock_mode_enable)
*
* @return None.
*/
EMMC_ERROR_CODE emmc_terminate (void)
EMMC_ERROR_CODE __attribute__((optimize("O0"))) emmc_terminate (void)
{
EMMC_ERROR_CODE result;

Expand Down Expand Up @@ -202,7 +202,7 @@ __inline static void emmc_set_data_timeout (
*
* @return None.
*/
static void emmc_drv_init(void)
static void __attribute__((optimize("O0"))) emmc_drv_init(void)
{
/* initialize */
emmc_memset((uint8_t *)(&mmc_drv_obj), 0, sizeof(st_mmc_base));
Expand Down
27 changes: 15 additions & 12 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
#include "dgtable.h"
#include "bit.h"
#include "cpudrv.h"
#if EMMC == 1
#include "dgemmc.h"
#endif /* EMMC == 1 */
#include "scifdrv.h"
#include "devdrv.h"
#include "rpcqspidrv.h"
#include "dgmodul1.h"
#include "dgmodul4.h"
#include "tzc_400.h"
#include "mmio.h"
Expand All @@ -24,6 +19,13 @@
#include "syc.h"
#include "ddr.h"
#include "sysc.h"
#if (SERIAL_FLASH == 1)
#include "rpcqspidrv.h"
#include "dgmodul1.h"
#endif
#if EMMC == 1
#include "dgemmc.h"
#endif /* EMMC == 1 */

#define RZG2L_DEVID (0x841C447)
#define RZV2L_DEVID (0x8447447)
Expand All @@ -45,10 +47,8 @@ uint32_t gDumpStatus;

#define RZG2L_SYC_INCK_HZ (24000000)

void Main(void)
void __attribute__((optimize("O0"))) Main(void)
{
uint32_t readDevId;

init_tzc_400_spimulti();

/* early setup Clock and Reset */
Expand All @@ -74,16 +74,19 @@ void Main(void)
gDumpMode = SIZE_8BIT;
gDumpStatus = DISABLE;

InitRPC_Mode();
ReadQspiFlashID(&readDevId); /* dummy */

InitMain();
StartMess();
DecCom();
}

void InitMain(void)
{
#if (SERIAL_FLASH == 1)
uint32_t readDevId;

InitRPC_Mode();
ReadQspiFlashID(&readDevId); /* dummy */
#endif
#if EMMC == 1
dg_init_emmc();
#endif /* EMMC == 1 */
Expand Down Expand Up @@ -140,7 +143,7 @@ void DecCom(void)
char tmp[64], chCnt, chPtr;
uint32_t rtn = 0;
uint32_t res;
chCnt = 1;
chCnt = 0;

while (rtn == 0)
{
Expand Down
Loading

0 comments on commit 73277c3

Please sign in to comment.