mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-12 12:08:56 +01:00
qcom: Moving SMEM into common location
The SMEM is used for all the platforms like ipq40xx and ipq807x. So moving this into a common place to use all qcom platforms. Change-Id: I04f0bf0e7aad0eae71024d734d8049a3470d510d Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
This commit is contained in:
parent
3983a7aa1d
commit
f464f73be8
10 changed files with 15 additions and 56 deletions
|
|
@ -1 +1,4 @@
|
|||
obj-y := timer.o
|
||||
ccflags-y += -I$(srctree)/board/qca/ipq40xx/
|
||||
|
||||
obj-y := smem.o
|
||||
obj-y += timer.o
|
||||
|
|
|
|||
|
|
@ -33,12 +33,10 @@
|
|||
#include <asm/io.h>
|
||||
#include <asm/errno.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <asm/arch-ipq40xx/smem.h>
|
||||
#include <asm/arch-qcom-common/smem.h>
|
||||
#include <nand.h>
|
||||
#include "ipq40xx.h"
|
||||
|
||||
extern int nand_env_device;
|
||||
extern board_ipq40xx_params_t *gboard_param;
|
||||
|
||||
#define BUILD_ID_LEN 32
|
||||
|
||||
|
|
@ -266,7 +264,6 @@ unsigned int get_partition_table_offset(void)
|
|||
int smem_getpart(char *part_name, uint32_t *start, uint32_t *size)
|
||||
{
|
||||
unsigned i;
|
||||
qca_smem_flash_info_t *sfi = &qca_smem_flash_info;
|
||||
struct smem_ptn *p;
|
||||
|
||||
for (i = 0; i < smem_ptable.len; i++) {
|
||||
|
|
@ -397,51 +394,13 @@ int smem_ram_ptable_init(struct smem_ram_ptable *smem_ram_ptable)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get nand block size by device id.
|
||||
* dev_id is 0 for parallel nand.
|
||||
* dev_id is 1 for spi nand.
|
||||
*/
|
||||
uint32_t get_nand_block_size(uint8_t dev_id)
|
||||
{
|
||||
#if 0
|
||||
struct mtd_info *mtd;
|
||||
|
||||
mtd = &nand_info[dev_id];
|
||||
|
||||
return mtd->erasesize;
|
||||
#endif
|
||||
return 0; //fix_me
|
||||
}
|
||||
|
||||
/*
|
||||
* get flash block size based on partition name.
|
||||
*/
|
||||
static inline uint32_t get_flash_block_size(char *name,
|
||||
qca_smem_flash_info_t *smem)
|
||||
{
|
||||
return (get_which_flash_param(name) == 1) ?
|
||||
get_nand_block_size(gboard_param->spi_nand_available)
|
||||
: smem->flash_block_size;
|
||||
}
|
||||
|
||||
#define part_which_flash(p) (((p)->attr & 0xff000000) >> 24)
|
||||
|
||||
static inline uint32_t get_part_block_size(struct smem_ptn *p,
|
||||
qca_smem_flash_info_t *sfi)
|
||||
{
|
||||
return (part_which_flash(p) == 1) ?
|
||||
get_nand_block_size(gboard_param->spi_nand_available)
|
||||
: sfi->flash_block_size;
|
||||
}
|
||||
#define part_which_flash(p) (((p)->attr & 0xff000000) >> 24)
|
||||
|
||||
void qca_set_part_entry(char *name, qca_smem_flash_info_t *smem,
|
||||
qca_part_entry_t *part, uint32_t start, uint32_t size)
|
||||
{
|
||||
uint32_t bsize = get_flash_block_size(name, smem);
|
||||
|
||||
part->offset = ((loff_t)start) * bsize;
|
||||
part->size = ((loff_t)size) * bsize;
|
||||
part->offset = ((loff_t)start) * smem->flash_block_size;
|
||||
part->size = ((loff_t)size) * smem->flash_block_size;
|
||||
}
|
||||
|
||||
uint32_t qca_smem_get_flash_block_size(void)
|
||||
|
|
@ -449,7 +408,6 @@ uint32_t qca_smem_get_flash_block_size(void)
|
|||
return qca_smem_flash_info.flash_block_size;
|
||||
}
|
||||
|
||||
static char parts[4096];
|
||||
|
||||
char *qca_smem_part_to_mtdparts(char *mtdid)
|
||||
{
|
||||
|
|
@ -533,7 +491,6 @@ int do_smeminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
{
|
||||
qca_smem_flash_info_t *sfi = &qca_smem_flash_info;
|
||||
int i;
|
||||
uint32_t bsize;
|
||||
|
||||
printf( "flash_type: 0x%x\n"
|
||||
"flash_index: 0x%x\n"
|
||||
|
|
@ -555,13 +512,12 @@ int do_smeminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
for (i = 0; i < smem_ptable.len; i++) {
|
||||
struct smem_ptn *p = &smem_ptable.parts[i];
|
||||
loff_t psize;
|
||||
bsize = get_part_block_size(p, sfi);
|
||||
|
||||
psize = ((loff_t)p->size) * bsize;
|
||||
psize = ((loff_t)p->size) * sfi->flash_block_size;
|
||||
|
||||
printf("%3d: " smem_ptn_name_fmt " 0x%08x %#16llx %#16llx\n",
|
||||
i, p->name, p->attr, ((loff_t)p->start) *
|
||||
bsize, psize);
|
||||
sfi->flash_block_size, psize);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
ccflags-y += -I$(srctree)/board/qca/ipq40xx/
|
||||
|
||||
obj-y := smem.o
|
||||
obj-y += gpio.o
|
||||
obj-y += scm.o
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <asm/arch-ipq40xx/iomap.h>
|
||||
#include <asm/arch-qcom-common/iomap.h>
|
||||
#include <asm/arch-qcom-common/gpio.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "ipq40xx_board_param.h"
|
||||
#include <nand.h>
|
||||
#include <part.h>
|
||||
#include <asm/arch-ipq40xx/smem.h>
|
||||
#include <asm/arch-qcom-common/smem.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#ifndef _IPQ40XX_BOARD_PARAM_H_
|
||||
#define _IPQ40XX_BOARD_PARAM_H_
|
||||
|
||||
#include <asm/arch-ipq40xx/iomap.h>
|
||||
#include <asm/arch-qcom-common/iomap.h>
|
||||
#include <asm/arch-qcom-common/gpio.h>
|
||||
#include <linux/sizes.h>
|
||||
#include "ipq40xx.h"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include <asm/io.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/arch-qcom-common/gpio.h>
|
||||
#include <asm/arch-ipq40xx/iomap.h>
|
||||
#include <asm/arch-qcom-common/iomap.h>
|
||||
#include "qca_qup_spi.h"
|
||||
|
||||
static int check_bit_state(uint32_t reg_addr, int bit_num, int val, int us_delay)
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
#define CONFIG_DTB_LOAD_ADDR 0x4AE00000
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS "fdtcontroladdr=0x4AE00000\0"
|
||||
|
||||
#define CONFIG_QCA_SMEM_BASE 0x41000000
|
||||
/*
|
||||
* SPI Flash Configs
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue