| Index: platform/stm32f7xx/include/platform/sdram.h
|
| diff --git a/app/lkboot/pdcc.h b/platform/stm32f7xx/include/platform/sdram.h
|
| similarity index 61%
|
| copy from app/lkboot/pdcc.h
|
| copy to platform/stm32f7xx/include/platform/sdram.h
|
| index 068b878c8ce3ef67f35b84d3c12e46d0b3d7e657..00788f4a37a41dc367a49791476764dbcfbb76ac 100644
|
| --- a/app/lkboot/pdcc.h
|
| +++ b/platform/stm32f7xx/include/platform/sdram.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (c) 2015 Travis Geiselbrecht
|
| + * Copyright (c) 2015 Carlos Pizano-Uribe <cpu@chromium.org>
|
| *
|
| * Permission is hereby granted, free of charge, to any person obtaining
|
| * a copy of this software and associated documentation files
|
| @@ -24,30 +24,33 @@
|
|
|
| #include <stdint.h>
|
|
|
| -/* in memory and DCC descriptors for the PDCC protocol */
|
| -
|
| -/* shared outside of lk repository, be careful of modifications */
|
| -#define PDCC_VERSION 1
|
| -
|
| -struct pdcc_buffer_descriptor {
|
| - uint32_t version;
|
| +enum sdram_bus_width {
|
| + SDRAM_BUS_WIDTH_8,
|
| + SDRAM_BUS_WIDTH_16,
|
| + SDRAM_BUS_WIDTH_32
|
| +};
|
|
|
| - uint32_t htod_buffer_phys;
|
| - uint32_t htod_buffer_len;
|
| +enum sdram_cas_latency {
|
| + SDRAM_CAS_LATENCY_1,
|
| + SDRAM_CAS_LATENCY_2,
|
| + SDRAM_CAS_LATENCY_3
|
| +};
|
|
|
| - uint32_t dtoh_buffer_phys;
|
| - uint32_t dtoh_buffer_len;
|
| +enum sdram_col_bits_num {
|
| + SDRAM_COLUMN_BITS_8,
|
| + SDRAM_COLUMN_BITS_9,
|
| + SDRAM_COLUMN_BITS_10,
|
| + SDRAM_COLUMN_BITS_11
|
| };
|
|
|
| -#define PDCC_VALID (1<<31)
|
| -#define PDCC_OPCODE_SHIFT (24)
|
| -#define PDCC_OPCODE(x) (((x) >> PDCC_OPCODE_SHIFT) & 0x7f)
|
| -#define PDCC_DATA(x) ((x) & 0x00ffffff);
|
| +typedef struct _sdram_config {
|
| + enum sdram_bus_width bus_width;
|
| + enum sdram_cas_latency cas_latency;
|
| + enum sdram_col_bits_num col_bits_num;
|
| +} sdram_config_t;
|
|
|
| -enum {
|
| - PDCC_OP_RESET = 0,
|
| - PDCC_OP_BUF_HEADER,
|
| - PDCC_OP_UPDATE_OUT_INDEX,
|
| - PDCC_OP_CONSUMED_IN,
|
| -};
|
| +// Left to each target to define the GPIO to DRAM bus mapping.
|
| +void stm_sdram_GPIO_init(void);
|
| +
|
| +uint8_t stm32_sdram_init(sdram_config_t* config);
|
|
|
|
|