Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zephyr Firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel Firmware
Zephyr Firmware
Commits
4b5093a6
Commit
4b5093a6
authored
Aug 20, 2022
by
Raptor Engineering Development Team
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port bare metal Arctic Tern HDMI transceiver setup to Zephyr firmware
parent
f8254000
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
kestrel/src/kestrel.c
kestrel/src/kestrel.c
+49
-0
No files found.
kestrel/src/kestrel.c
View file @
4b5093a6
...
...
@@ -56,6 +56,7 @@ LOG_MODULE_REGISTER(kestrel_core, LOG_LEVEL_DBG);
// Host platform configuration
#define HOST_PLATFORM_FPGA_I2C_ADDRESS 0x31
#define HDMI_TRANSCEIVER_I2C_ADDRESS 0x4c
// Limits
#define FLASH_WRITE_LOCATION_RETRY_LIMIT 5
...
...
@@ -64,6 +65,7 @@ LOG_MODULE_REGISTER(kestrel_core, LOG_LEVEL_DBG);
#define CPU0_I2C_MASTER_BASE_ADDR I2CMASTER0_BASE
#define CPU1_I2C_MASTER_BASE_ADDR I2CMASTER1_BASE
#define P9PS_I2C_MASTER_BASE_ADDR I2CMASTER4_BASE
#define HDMI_I2C_MASTER_BASE_ADDR I2CMASTER4_BASE
// Front panel interface
// FIXME: Convert LEDs to device tree
...
...
@@ -457,6 +459,50 @@ static void gpio_init(void)
gpio1_oe_write
(
gpio1_oe_read
()
|
(
0x01
<<
POWER_LED_OUT_GPIO
));
}
static
void
configure_hdmi_transceiver
(
uint8_t
*
i2c_master_base_addr
)
{
// ***** Set up the ITE HDMI transceiver *****
printf
(
"Setting up HDMI transceiver..."
);
// ***** GENERAL *****
// Reset device
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x4
,
0x1c
);
// ***** VIDEO *****
// Set bank 0
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x0f
,
0x08
);
// 0x0f[1:0] = 0
// AVMute output
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0xc1
,
0x01
);
// 0xc1[0] = 1
// Take device out of reset
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x04
,
0x00
);
// Enable HDMI transmitter reset
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x61
,
0x10
);
// Configure input signal
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x70
,
0x00
);
// RGB mode, I/O latch at TxClk, non-CCIR656, non-embedded sync, single edge, no PCLK delay
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x90
,
0x00
);
// PG horizontal total = 0, H/V sync provided by external driver, active low VSYNC, active low HSYNC, Data Enable provided by external driver
// Enable DVI mode (works for HDMI as well, host should configure HDMI later in the boot process)
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0xc0
,
0x00
);
// 0xc0[0] = 0
// Release HDMI transmitter reset
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0x61
,
0x00
);
// 0x61[4] = 0
// Un-AVMute output
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0xc1
,
0x00
);
// 0xc1[0] = 0
// ***** AUDIO *****
// Disable audio channel
i2c_write_register_byte
(
i2c_master_base_addr
,
HDMI_TRANSCEIVER_I2C_ADDRESS
,
0xe0
,
0x08
);
// 0xe0[3:0] = 0
printf
(
"done!
\n
"
);
}
static
void
set_lpc_slave_irq_enable
(
uint8_t
enabled
)
{
if
(
!
enabled
)
...
...
@@ -3703,6 +3749,9 @@ int kestrel_init(void)
#endif
}
// Set up display output
configure_hdmi_transceiver
((
uint8_t
*
)
HDMI_I2C_MASTER_BASE_ADDR
);
main_firmware_buffer
.
locked
=
1
;
main_firmware_buffer
.
buffer_length
=
(
64
+
2
)
*
1024LL
*
1024LL
;
#if (WITH_ZEPHYR)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment