coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chipset.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* TODO: Check if this is still correct */
4 
5 #include <bl_uapp/bl_syscall_public.h>
6 #include <console/console.h>
7 #include <psp_verstage.h>
8 
9 uint32_t update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset)
10 {
11  return svc_update_psp_bios_dir(psp_dir_offset, bios_dir_offset);
12 }
13 
15 {
16  return svc_save_uapp_data(address, size);
17 }
18 
20 {
21  return ef_table->bios3_entry;
22 }
23 
24 int platform_set_sha_op(enum vb2_hash_algorithm hash_alg,
25  struct sha_generic_data *sha_op)
26 {
27  if (hash_alg == VB2_HASH_SHA256) {
28  sha_op->SHAType = SHA_TYPE_256;
29  sha_op->DigestLen = 32;
30  } else if (hash_alg == VB2_HASH_SHA384) {
31  sha_op->SHAType = SHA_TYPE_384;
32  sha_op->DigestLen = 48;
33  } else {
34  return -1;
35  }
36  return 0;
37 }
38 
39 
40 /* Functions below are stub functions for not-yet-implemented PSP features.
41  * These functions should be replaced with proper implementations later.
42  */
43 
45 {
46  return 0;
47 }
48 
49 void platform_report_mode(int developer_mode_enabled)
50 {
51  printk(BIOS_INFO, "Reporting %s mode\n",
52  developer_mode_enabled ? "Developer" : "Normal");
53  if (developer_mode_enabled)
54  svc_set_platform_boot_mode(CHROME_BOOK_BOOT_MODE_DEVELOPER);
55  else
56  svc_set_platform_boot_mode(CHROME_BOOK_BOOT_MODE_NORMAL);
57 }
void platform_report_mode(int developer_mode_enabled)
Definition: chipset.c:37
int platform_set_sha_op(enum vb2_hash_algorithm hash_alg, struct sha_generic_data *sha_op)
Definition: chipset.c:22
uint32_t update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset)
Definition: chipset.c:7
uint32_t save_uapp_data(void *address, uint32_t size)
Definition: chipset.c:12
uint32_t get_bios_dir_addr(struct embedded_firmware *ef_table)
Definition: chipset.c:17
uint32_t svc_update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset)
Definition: svc.c:84
uint32_t svc_set_platform_boot_mode(enum chrome_platform_boot_mode boot_mode)
Definition: svc.c:137
uint32_t svc_save_uapp_data(void *address, uint32_t size)
Definition: svc.c:93
#define printk(level,...)
Definition: stdlib.h:16
uint64_t address
Definition: fw_cfg_if.h:0
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
uint32_t svc_write_postcode(uint32_t postcode)
Definition: chipset.c:44
unsigned int uint32_t
Definition: stdint.h:14
uint32_t bios3_entry
Definition: psp_efs.h:46
static struct sha_generic_data sha_op
Definition: vboot_crypto.c:14