mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ARM: qca: moving function get_smem_spi_addr_len specific to core
Change-Id: I45c8c8bfe549998e96e2054c009b41ddbdd3a587 Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
This commit is contained in:
parent
f3af149d5f
commit
20c19839b0
3 changed files with 23 additions and 17 deletions
|
|
@ -155,7 +155,7 @@ qca_smem_bootconfig_info_t qca_smem_bootconfig_info;
|
|||
*
|
||||
* NOTE: buf MUST be 4byte aligned, and len MUST be a multiple of 8.
|
||||
*/
|
||||
static unsigned smem_read_alloc_entry(smem_mem_type_t type, void *buf, int len)
|
||||
unsigned smem_read_alloc_entry(smem_mem_type_t type, void *buf, int len)
|
||||
{
|
||||
struct smem_alloc_info *ainfo;
|
||||
unsigned *dest = buf;
|
||||
|
|
@ -253,23 +253,9 @@ unsigned int get_rootfs_active_partition(void)
|
|||
return 0; /* alt partition not available */
|
||||
}
|
||||
|
||||
/*
|
||||
* To determine the spi flash addr is in 3 byte
|
||||
* or 4 byte.
|
||||
*/
|
||||
unsigned int get_smem_spi_addr_len(void)
|
||||
__weak unsigned int get_smem_spi_addr_len(void)
|
||||
{
|
||||
int ret;
|
||||
uint32_t spi_flash_addr_len;
|
||||
|
||||
ret = smem_read_alloc_entry(SMEM_SPI_FLASH_ADDR_LEN,
|
||||
&spi_flash_addr_len, sizeof(uint32_t));
|
||||
if (ret != 0) {
|
||||
printf("SPI: using 3 byte address mode as default\n");
|
||||
spi_flash_addr_len = 3;
|
||||
}
|
||||
|
||||
return spi_flash_addr_len;
|
||||
return SPI_DEFAULT_ADDR_LEN;
|
||||
}
|
||||
|
||||
unsigned int get_partition_table_offset(void)
|
||||
|
|
|
|||
|
|
@ -75,4 +75,5 @@ extern int dump_entries_s;
|
|||
#define MMC_DATA_TRANSFER_SDHCI_MODE 2
|
||||
#define MMC_MODE_HC 0x800
|
||||
|
||||
#define SPI_DEFAULT_ADDR_LEN 3
|
||||
#endif /* __QCA_COMMON_H_ */
|
||||
|
|
|
|||
|
|
@ -965,3 +965,22 @@ void set_flash_secondary_type(qca_smem_flash_info_t *smem)
|
|||
{
|
||||
return;
|
||||
};
|
||||
|
||||
/*
|
||||
* To determine the spi flash addr is in 3 byte
|
||||
* or 4 byte.
|
||||
*/
|
||||
unsigned int get_smem_spi_addr_len(void)
|
||||
{
|
||||
int ret;
|
||||
uint32_t spi_flash_addr_len;
|
||||
|
||||
ret = smem_read_alloc_entry(SMEM_SPI_FLASH_ADDR_LEN,
|
||||
&spi_flash_addr_len, sizeof(uint32_t));
|
||||
if (ret != 0) {
|
||||
printf("SPI: using 3 byte address mode as default\n");
|
||||
spi_flash_addr_len = SPI_DEFAULT_ADDR_LEN;
|
||||
}
|
||||
|
||||
return spi_flash_addr_len;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue