ipq807x: Removed spi gpio entries from device-tree

Removed spi-gpio entried from device-tree and
added to static board param structure.

This change helps free-up 10KB so that we will
be able to accomodate another device-tree entry.

Change-Id: If0f53b611ac838ad5cec7e6a2a48c6064732ce22
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
This commit is contained in:
Gokul Sriram Palanisamy 2019-11-22 15:27:59 +05:30
parent a8f7e1ee33
commit ceea3ed10f
3 changed files with 66 additions and 46 deletions

View file

@ -61,51 +61,6 @@
compatible = "qcom,spi-qup-v2.7.0";
wr_pipe_0 = <12>;
rd_pipe_0 = <13>;
spi_gpio {
gpio1 {
gpio = <38>;
func = <3>;
pull = <GPIO_PULL_UP>;
drvstr = <GPIO_2MA>;
oe = <GPIO_OE_DISABLE>;
vm = <GPIO_VM_ENABLE>;
od_en = <GPIO_OD_DISABLE>;
pu_res = <GPIO_PULL_RES2>;
};
gpio2 {
gpio = <39>;
func = <3>;
pull = <GPIO_PULL_UP>;
drvstr = <GPIO_2MA>;
oe = <GPIO_OE_DISABLE>;
vm = <GPIO_VM_ENABLE>;
od_en = <GPIO_OD_DISABLE>;
pu_res = <GPIO_PULL_RES2>;
};
gpio3 {
gpio = <40>;
func = <2>;
pull = <GPIO_PULL_UP>;
drvstr = <GPIO_2MA>;
oe = <GPIO_OE_DISABLE>;
vm = <GPIO_VM_ENABLE>;
od_en = <GPIO_OD_DISABLE>;
pu_res = <GPIO_PULL_RES2>;
};
gpio4 {
gpio = <41>;
func = <2>;
pull = <GPIO_PULL_UP>;
drvstr = <GPIO_2MA>;
oe = <GPIO_OE_DISABLE>;
vm = <GPIO_VM_ENABLE>;
od_en = <GPIO_OD_DISABLE>;
pu_res = <GPIO_PULL_RES2>;
};
};
};
nand: nand-controller@79B0000 {

View file

@ -138,6 +138,52 @@ struct dumpinfo_t dumpinfo_s[] = {
};
int dump_entries_s = ARRAY_SIZE(dumpinfo_s);
gpio_func_data_t spi_nor_gpio[] = {
{
.gpio = 38,
.func = 3,
.pull = 3,
.oe = 0,
.vm = 1,
.od_en = 0,
.pu_res = 2,
},
{
.gpio = 39,
.func = 3,
.pull = 3,
.oe = 0,
.vm = 1,
.od_en = 0,
.pu_res = 2,
},
{
.gpio = 40,
.func = 2,
.pull = 3,
.oe = 0,
.vm = 1,
.od_en = 0,
.pu_res = 2,
},
{
.gpio = 41,
.func = 2,
.pull = 3,
.oe = 0,
.vm = 1,
.od_en = 0,
.pu_res = 2,
},
};
board_ipq807x_param_t gboard_param = {
.spi_nor_cfg = {
.gpio = spi_nor_gpio,
.gpio_count = ARRAY_SIZE(spi_nor_gpio),
},
};
void uart2_configure_mux(void)
{
unsigned long cfg_rcgr;
@ -597,6 +643,7 @@ void board_nand_init(void)
{
#ifdef CONFIG_QCA_SPI
int gpio_node;
int i;
#endif
qpic_nand_init();
@ -605,8 +652,14 @@ void board_nand_init(void)
gpio_node = fdt_path_offset(gd->fdt_blob, "/spi/spi_gpio");
if (gpio_node >= 0) {
qca_gpio_init(gpio_node);
ipq_spi_init(CONFIG_IPQ_SPI_NOR_INFO_IDX);
} else {
/* Setting default values */
for (i = 0; i < gboard_param.spi_nor_cfg.gpio_count; i++)
gpio_tlmm_config(&gboard_param.spi_nor_cfg.gpio[i]);
}
ipq_spi_init(CONFIG_IPQ_SPI_NOR_INFO_IDX);
#endif
}

View file

@ -17,6 +17,7 @@
#include <configs/ipq807x.h>
#include <asm/u-boot.h>
#include <asm/arch-qca-common/qca_common.h>
#include <asm/arch-qca-common/gpio.h>
/*
* GCC-SDCC Registers
@ -305,6 +306,17 @@ extern const char *rsvd_node;
extern const char *del_node[];
extern const add_node_t add_fdt_node[];
typedef struct qca_gpio_config gpio_func_data_t;
typedef struct {
gpio_func_data_t *gpio;
unsigned int gpio_count;
}spi_cfg_t;
typedef struct {
spi_cfg_t spi_nor_cfg;
}board_ipq807x_param_t;
void reset_crashdump(void);
#ifdef CONFIG_PCI_IPQ
void board_pci_init(int id);