coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
boot/coreboot_tables.h
>
4
#include <
device/device.h
>
5
#include <gpio.h>
6
#include <soc/clock.h>
7
#include <soc/soc_services.h>
8
#include <soc/usb.h>
9
#include <soc/blsp.h>
10
#include <symbols.h>
11
12
#include <vendorcode/google/chromeos/chromeos.h>
13
#include "
mmu.h
"
14
15
#define USB_ENABLE_GPIO 51
16
17
static
void
setup_usb
(
void
)
18
{
19
usb_clock_config
();
20
21
setup_usb_host1
();
22
}
23
24
static
void
mainboard_init
(
struct
device
*dev)
25
{
26
/* disable mmu and d-cache before setting up secure world.*/
27
dcache_mmu_disable
();
28
start_tzbsp
();
29
/* Setup mmu and d-cache again as non secure entries. */
30
setup_mmu
(
DRAM_INITIALIZED
);
31
setup_usb
();
32
33
/* Copy WIFI calibration data into CBMEM. */
34
if
(
CONFIG
(CHROMEOS))
35
cbmem_add_vpd_calibration_data();
36
37
/*
38
* Make sure bootloader can issue sounds The frequency is calculated
39
* as "<frame_rate> * <bit_width> * <channels> * 4", i.e.
40
*
41
* 48000 * 2 * 16 * 4 = 6144000
42
*/
43
//audio_clock_config(6144000);
44
}
45
46
static
void
mainboard_enable
(
struct
device
*dev)
47
{
48
dev->
ops
->
init
= &
mainboard_init
;
49
}
50
51
struct
chip_operations
mainboard_ops
= {
52
.
enable_dev
=
mainboard_enable
,
53
};
54
55
void
lb_board
(
struct
lb_header
*
header
)
56
{
57
struct
lb_range
*
dma
;
58
59
dma
= (
struct
lb_range
*)
lb_new_record
(
header
);
60
dma
->tag =
LB_TAG_DMA
;
61
dma
->size =
sizeof
(*dma);
62
dma
->range_start = (
uintptr_t
)_dma_coherent;
63
dma
->range_size =
REGION_SIZE
(
dma_coherent
);
64
65
if
(
CONFIG
(CHROMEOS)) {
66
/* Retrieve the switch interface MAC addresses. */
67
lb_table_add_macs_from_vpd
(
header
);
68
}
69
}
mainboard_ops
struct chip_operations mainboard_ops
Definition:
mainboard.c:19
header
struct arm64_kernel_header header
Definition:
fit_payload.c:30
dcache_mmu_disable
void dcache_mmu_disable(void)
Definition:
cache.c:49
LB_TAG_DMA
@ LB_TAG_DMA
Definition:
coreboot_tables.h:62
dma_coherent
int dma_coherent(void *ptr)
CONFIG
@ CONFIG
Definition:
dsi_common.h:201
lb_board
void lb_board(struct lb_header *header)
Definition:
mainboard.c:325
mainboard_init
static void mainboard_init(struct device *dev)
Definition:
mainboard.c:24
setup_usb
static void setup_usb(void)
Definition:
mainboard.c:17
mainboard_enable
static void mainboard_enable(struct device *dev)
Definition:
mainboard.c:46
coreboot_tables.h
lb_new_record
struct lb_record * lb_new_record(struct lb_header *header)
Definition:
coreboot_table.c:70
lb_table_add_macs_from_vpd
void lb_table_add_macs_from_vpd(struct lb_header *header)
device.h
REGION_SIZE
#define REGION_SIZE(name)
Definition:
symbols.h:10
start_tzbsp
void start_tzbsp(void)
Definition:
blobs_init.c:106
setup_mmu
void setup_mmu(enum dram_state dram)
Definition:
mmu.c:40
DRAM_INITIALIZED
@ DRAM_INITIALIZED
Definition:
mmu.h:13
dma
struct @1399 * dma
usb_clock_config
void usb_clock_config(void)
usb_clock_config - configure USB controller clocks and reset the controller
Definition:
clock.c:68
setup_usb_host1
void setup_usb_host1(void)
Definition:
usb.c:274
mmu.h
uintptr_t
unsigned long uintptr_t
Definition:
stdint.h:21
chip_operations
Definition:
device.h:23
chip_operations::enable_dev
void(* enable_dev)(struct device *dev)
Definition:
device.h:24
device_operations::init
void(* init)(struct device *dev)
Definition:
device.h:42
device
Definition:
device.h:107
device::ops
struct device_operations * ops
Definition:
device.h:143
lb_header
Definition:
coreboot_tables.h:108
lb_range
Definition:
coreboot_tables.h:310
src
mainboard
google
gale
mainboard.c
Generated by
1.9.1