Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: platform/stm32f7xx/include/platform/sdram.h

Issue 1324223002: move stmf7 sdram code to /platform (Closed) Base URL: https://github.com/travisg/lk.git@master
Patch Set: review fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | platform/stm32f7xx/rules.mk » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | platform/stm32f7xx/rules.mk » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698