coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cdp.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <device/mmio.h>
4 #include <gpio.h>
5 #include <soc/cdp.h>
6 #include <soc/ebi2.h>
7 #include <soc/clock.h>
8 #include <types.h>
9 #include <boardid.h>
10 
11 void ipq_configure_gpio(const gpio_func_data_t *gpio, unsigned int count)
12 {
13  int i;
14 
15  for (i = 0; i < count; i++) {
16  gpio_tlmm_config(gpio->gpio, gpio->func, gpio->dir,
17  gpio->pull, gpio->drvstr, gpio->enable);
18  gpio++;
19  }
20 }
21 
22 static void configure_nand_gpio(void)
23 {
24  /* EBI2 CS, CLE, ALE, WE, OE */
30 
31  /* EBI2 BUSY */
33 
34  /* EBI2 D7 - D0 */
43 }
44 
45 void board_nand_init(void)
46 {
47  struct ebi2cr_regs *ebi2_regs;
48 
50  return;
51 
52  ebi2_regs = (struct ebi2cr_regs *) EBI2CR_BASE;
53 
56 
57  /* NAND Flash is connected to CS0 */
60 }
uint32_t board_id(void)
board_id() - Get the board version
Definition: ec_boardid.c:6
void ipq_configure_gpio(const gpio_func_data_t *gpio, unsigned int count)
Definition: cdp.c:8
#define clrsetbits32(addr, clear, set)
Definition: mmio.h:16
#define EBI2CR_BASE
Definition: ebi2.h:8
#define CS0_CFG_MASK
Definition: ebi2.h:75
#define CS0_CFG_SERIAL_FLASH_DEVICE
Definition: ebi2.h:77
@ BOARD_ID_PROTO_0_2_NAND
Definition: cdp.h:113
@ GPIO_10MA
Definition: gpio_common.h:74
@ GPIO_KEEPER
Definition: gpio_common.h:64
@ GPIO_NO_PULL
Definition: gpio_common.h:62
void nand_clock_config(void)
nand_clock_config - configure NAND controller clocks
Definition: clock.c:56
#define GPIO_DISABLE
Definition: gpio.h:37
#define GPIO_PULL_UP
Definition: gpio.h:24
static void gpio_tlmm_config(unsigned int gpio, unsigned int func, unsigned int dir, unsigned int pull, unsigned int drvstr, unsigned int enable)
Definition: gpio.h:82
static void configure_nand_gpio(void)
Definition: cdp.c:22
void board_nand_init(void)
Definition: cdp.c:45
uint32_t chip_select_cfg0
Definition: ebi2.h:11
Definition: pinmux.c:36
unsigned int func
Definition: pinmux.c:38
unsigned int pull
Definition: pinmux.c:39
#define count