Skip to content

Commit

Permalink
Merge pull request #92 from YuzukiHD/dev
Browse files Browse the repository at this point in the history
[driver] add basic driver for dram param
  • Loading branch information
YuzukiTsuru authored May 27, 2024
2 parents 7d1ec0f + 6aeaa39 commit 7335ddf
Show file tree
Hide file tree
Showing 6 changed files with 1,621 additions and 1,589 deletions.
8 changes: 7 additions & 1 deletion board/avaota-a1/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ sunxi_i2c_t i2c_pmu = {
.gpio_sda = {GPIO_PIN(GPIO_PORTL, 1), GPIO_PERIPH_MUX2},
};

enum dram_training_type {
DRAM_TRAINING_OFF = 0x60,
DRAM_TRAINING_HALF = 0x860,
DRAM_TRAINING_FULL = 0xc60,
};

const uint32_t dram_para[32] = {
1200,
0x8,
Expand Down Expand Up @@ -135,7 +141,7 @@ const uint32_t dram_para[32] = {
0x802f3333,
0xc7c5c4c2,
0x3533302f,
0x060,
DRAM_TRAINING_HALF,
0x48484848,
};

Expand Down
2 changes: 1 addition & 1 deletion board/avaota-a1/extlinux_boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ int main(void) {
enable_sram_a3();

/* Initialize the DRAM and enable memory management unit (MMU). */
uint64_t dram_size = sunxi_dram_init(NULL);
uint64_t dram_size = sunxi_dram_init((void *) dram_para);

printk_debug("DRAM Size = %dM\n", dram_size);

Expand Down
Loading

0 comments on commit 7335ddf

Please sign in to comment.