s5j/sflash: clean up unnecessary macro definition
There is no benefit in defineing a new macro for flash base address,
S5J_SFLASH_MAPPED_ADDRESS. Remove it for better readability.
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-#define S5J_SFLASH_MAPPED_ADDR (CONFIG_S5J_FLASH_BASE)
-
#define rSF_CON (SFI_BASE + 0x0004)
#define rERASE_ADDRESS (SFI_BASE + 0x0010)
#define rCOMMAND1 (SFI_BASE + 0x001C)
@@ -147,12 +145,12 @@ static uint8_t s5j_sflash_read_status(void)
size_t up_progmem_getaddress(size_t page)
{
- return S5J_SFLASH_MAPPED_ADDR + up_progmem_pagesize(page) * page;
+ return CONFIG_S5J_FLASH_BASE + up_progmem_pagesize(page) * page;
}
ssize_t up_progmem_getpage(size_t addr)
{
- return (addr - S5J_SFLASH_MAPPED_ADDR) / up_progmem_pagesize(0);
+ return (addr - CONFIG_S5J_FLASH_BASE) / up_progmem_pagesize(0);
}
ssize_t up_progmem_erasepage(size_t page)
@@ -171,7 +169,7 @@ ssize_t up_progmem_erasepage(size_t page)
s5j_sflash_disable_wp();
/* Set sector address and then send erase command */
- putreg32(addr - S5J_SFLASH_MAPPED_ADDR, rERASE_ADDRESS);
+ putreg32(addr - CONFIG_S5J_FLASH_BASE, rERASE_ADDRESS);
putreg8(0xff, rSE);
/* Wait for the completion */
