| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| config DRIVERS_GENESYSLOGIC_GL9755 | ||
| bool "Genesys Logic GL9755" | ||
| help | ||
| GL9755 is a PCI Express Rev. 2.1 compliant card reader controller | ||
| which integrates PCI Express PHY, UHS-II PHY, memory card access | ||
| interface, regulators (3.3V-to-1.8V and 3.3V-to-1.2V) and card | ||
| power switch. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ramstage-$(CONFIG_DRIVERS_GENESYSLOGIC_GL9755) += gl9755.c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| /* Driver for Genesys Logic GL9755 */ | ||
|
|
||
| #include <console/console.h> | ||
| #include <device/device.h> | ||
| #include <device/path.h> | ||
| #include <device/pci.h> | ||
| #include <device/pci_ops.h> | ||
| #include <device/pci_ids.h> | ||
| #include "gl9755.h" | ||
|
|
||
| static void gl9755_init(struct device *dev) | ||
| { | ||
| printk(BIOS_INFO, "GL9755: init\n"); | ||
| pci_dev_init(dev); | ||
|
|
||
| /* Set Vendor Config to be configurable */ | ||
| pci_or_config32(dev, CFG, CFG_EN); | ||
| /* Set LTR value */ | ||
| pci_write_config32(dev, LTR, NO_SNOOP_SCALE|NO_SNOOP_VALUE|SNOOP_SCALE|SNOOP_VALUE); | ||
| /* Set Vendor Config to be non-configurable */ | ||
| pci_and_config32(dev, CFG, ~CFG_EN); | ||
| } | ||
|
|
||
| static struct device_operations gl9755_ops = { | ||
| .read_resources = pci_dev_read_resources, | ||
| .set_resources = pci_dev_set_resources, | ||
| .enable_resources = pci_dev_enable_resources, | ||
| .ops_pci = &pci_dev_ops_pci, | ||
| .init = gl9755_init, | ||
| }; | ||
|
|
||
| static const unsigned short pci_device_ids[] = { | ||
| PCI_DEVICE_ID_GLI_9755, | ||
| 0 | ||
| }; | ||
|
|
||
| static const struct pci_driver genesyslogic_gl9755 __pci_driver = { | ||
| .ops = &gl9755_ops, | ||
| .vendor = PCI_VENDOR_ID_GLI, | ||
| .devices = pci_device_ids, | ||
| }; | ||
|
|
||
| struct chip_operations drivers_generic_genesyslogic_gl9755_ops = { | ||
| CHIP_NAME("Genesys Logic GL9755") | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| /* Definitions for Genesys Logic GL9755 */ | ||
|
|
||
| #define CFG 0x800 | ||
| #define CFG_EN 0x1 | ||
| #define LTR 0x5C | ||
| #define SNOOP_VALUE 0x25 | ||
| #define SNOOP_SCALE (0x3 << 10) | ||
| #define NO_SNOOP_VALUE (0x25 << 16) | ||
| #define NO_SNOOP_SCALE (0x3 << 26) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,6 @@ | |
| * Version: 2.1.1 | ||
| */ | ||
|
|
||
| #include <commonlib/endian.h> | ||
| #include <string.h> | ||
| #include <types.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ | |
| #include <FirmwareVersionInfoHob.h> | ||
| #endif | ||
|
|
||
| #pragma pack(pop) | ||
|
|
||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,6 @@ | |
|
|
||
| #define DMA_AUTOINIT 0x10 | ||
|
|
||
| void isa_dma_init(void) | ||
| { | ||
| /* slave at 0x00 - 0x0f */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ## SPDX-License-Identifier: GPL-2.0-only | ||
|
|
||
| config DRIVERS_TI_SN65DSI86BRIDGE | ||
| bool | ||
| default n | ||
| help | ||
| TI SN65DSI86 eDP bridge driver |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## SPDX-License-Identifier: GPL-2.0-only | ||
|
|
||
| ramstage-$(CONFIG_DRIVERS_TI_SN65DSI86BRIDGE) += sn65dsi86bridge.c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #ifndef __TI_SN65DSI86BRIDGE_H | ||
| #define __TI_SN65DSI86BRIDGE_H | ||
|
|
||
| #include <edid.h> | ||
|
|
||
| enum dp_pll_clk_src { | ||
| SN65_SEL_12MHZ = 0x0, | ||
| SN65_SEL_19MHZ = 0x1, | ||
| SN65_SEL_26MHZ = 0x2, | ||
| SN65_SEL_27MHZ = 0x3, | ||
| SN65_SEL_38MHZ = 0x4, | ||
| }; | ||
|
|
||
| void sn65dsi86_bridge_init(uint8_t bus, uint8_t chip, enum dp_pll_clk_src ref_clk); | ||
| void sn65dsi86_bridge_configure(uint8_t bus, uint8_t chip, | ||
| struct edid *edid, uint32_t num_of_lines, | ||
| uint32_t dsi_bpp); | ||
| enum cb_err sn65dsi86_bridge_read_edid(uint8_t bus, uint8_t chip, struct edid *out); | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ifeq ($(CONFIG_EC_SYSTEM76_EC),y) | ||
|
|
||
| all-y += system76_ec.c | ||
| smm-$(CONFIG_DEBUG_SMI) += system76_ec.c | ||
|
|
||
| endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #include <arch/io.h> | ||
| #include <console/system76_ec.h> | ||
| #include <timer.h> | ||
|
|
||
| // This is the command region for System76 EC firmware. It must be | ||
| // enabled for LPC in the mainboard. | ||
| #define SYSTEM76_EC_BASE 0x0E00 | ||
| #define SYSTEM76_EC_SIZE 256 | ||
|
|
||
| #define REG_CMD 0 | ||
| #define REG_RESULT 1 | ||
|
|
||
| // When command register is 0, command is complete | ||
| #define CMD_FINISHED 0 | ||
|
|
||
| // Print command. Registers are unique for each command | ||
| #define CMD_PRINT 4 | ||
| #define CMD_PRINT_REG_FLAGS 2 | ||
| #define CMD_PRINT_REG_LEN 3 | ||
| #define CMD_PRINT_REG_DATA 4 | ||
|
|
||
| static inline uint8_t system76_ec_read(uint8_t addr) | ||
| { | ||
| return inb(SYSTEM76_EC_BASE + (uint16_t)addr); | ||
| } | ||
|
|
||
| static inline void system76_ec_write(uint8_t addr, uint8_t data) | ||
| { | ||
| outb(data, SYSTEM76_EC_BASE + (uint16_t)addr); | ||
| } | ||
|
|
||
| void system76_ec_init(void) | ||
| { | ||
| // Clear entire command region | ||
| for (int i = 0; i < SYSTEM76_EC_SIZE; i++) | ||
| system76_ec_write((uint8_t)i, 0); | ||
| } | ||
|
|
||
| void system76_ec_flush(void) | ||
| { | ||
| system76_ec_write(REG_CMD, CMD_PRINT); | ||
|
|
||
| // Wait for command completion, for up to 10 milliseconds, with a | ||
| // test period of 1 microsecond | ||
| wait_us(10000, system76_ec_read(REG_CMD) == CMD_FINISHED); | ||
|
|
||
| system76_ec_write(CMD_PRINT_REG_LEN, 0); | ||
| } | ||
|
|
||
| void system76_ec_print(uint8_t byte) | ||
| { | ||
| uint8_t len = system76_ec_read(CMD_PRINT_REG_LEN); | ||
| system76_ec_write(CMD_PRINT_REG_DATA + len, byte); | ||
| system76_ec_write(CMD_PRINT_REG_LEN, len + 1); | ||
|
|
||
| // If we hit the end of the buffer, or were given a newline, flush | ||
| if (byte == '\n' || len >= (SYSTEM76_EC_SIZE - CMD_PRINT_REG_DATA)) | ||
| system76_ec_flush(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,4 @@ struct em100_msg { | |
| char data[MAX_MSG_LENGTH]; | ||
| } __packed; | ||
|
|
||
| #endif /* CONSOLE_SPI_H */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #ifndef CONSOLE_SYSTEM76_EC_H | ||
| #define CONSOLE_SYSTEM76_EC_H 1 | ||
|
|
||
| #include <stddef.h> | ||
| #include <stdint.h> | ||
|
|
||
| void system76_ec_init(void); | ||
| void system76_ec_flush(void); | ||
| void system76_ec_print(uint8_t byte); | ||
|
|
||
| #define __CONSOLE_SYSTEM76_EC_ENABLE__ (CONFIG(CONSOLE_SYSTEM76_EC) && \ | ||
| (ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE \ | ||
| || ENV_SEPARATE_VERSTAGE || ENV_POSTCAR \ | ||
| || (ENV_SMM && CONFIG(DEBUG_SMI)))) | ||
|
|
||
| #if __CONSOLE_SYSTEM76_EC_ENABLE__ | ||
| static inline void __system76_ec_init(void) | ||
| { | ||
| system76_ec_init(); | ||
| } | ||
| static inline void __system76_ec_tx_flush(void) | ||
| { | ||
| system76_ec_flush(); | ||
| } | ||
| static inline void __system76_ec_tx_byte(unsigned char byte) | ||
| { | ||
| system76_ec_print(byte); | ||
| } | ||
| #else | ||
| static inline void __system76_ec_init(void) {} | ||
| static inline void __system76_ec_tx_flush(void) {} | ||
| static inline void __system76_ec_tx_byte(unsigned char byte) {} | ||
| #endif | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,6 @@ typedef struct { | |
| u64 rsi; | ||
| u64 rdi; | ||
|
|
||
| u64 io_mem_addr; | ||
| u32 io_misc_info; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
|
|
||
| #include <console/post_codes.h> | ||
|
|
||
| #if CONFIG(POST_IO) | ||
| #define post_code(value) \ | ||
| movb $value, %al; \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,6 @@ | |
| #include <device/dram/common.h> | ||
| #include <types.h> | ||
|
|
||
| /** | ||
| * Convenience definitions for SPD offsets | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,7 +137,6 @@ struct device_path { | |
| }; | ||
| }; | ||
|
|
||
| #define DEVICE_PATH_MAX 40 | ||
| #define BUS_PATH_MAX (DEVICE_PATH_MAX+10) | ||
|
|
||
|
|
||