summaryrefslogtreecommitdiff
path: root/src/mainboard/google/veyron_pinky/sdram_configs.c
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2014-11-06 16:51:02 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-10 20:50:16 +0200
commit539e856643f9a7396638c05db5c4dbfb136e292b (patch)
tree5d07a3d65a633575a199063114d518ea3ed37cb1 /src/mainboard/google/veyron_pinky/sdram_configs.c
parenta0abd51e4edb6b00c82032234b8ae1868e6d965e (diff)
downloadcoreboot-539e856643f9a7396638c05db5c4dbfb136e292b.tar.xz
veyron*: sdram_get_ram_code() -> ram_code()
This enables RAM_CODE_SUPPORT for veyron* platforms and uses the generic gpio_get_binaries() function to read RAM_ID GPIOs. BUG=chrome-os-partner:31728 BRANCH=none TEST=built and booted on pinky Change-Id: I7a03e42a270bec7036004375d36734bfdfe6e528 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: a325b204ff88131dfb0bdd3dfedb3c007cd98010 Original-Signed-off-by: David Hendricks <dhendrix@chromium.org> Original-Change-Id: Ibc4c61687f1c59311cbf6b48371f9a9125dbe115 Original-Reviewed-on: https://chromium-review.googlesource.com/227249 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/9549 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/google/veyron_pinky/sdram_configs.c')
-rw-r--r--src/mainboard/google/veyron_pinky/sdram_configs.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/mainboard/google/veyron_pinky/sdram_configs.c b/src/mainboard/google/veyron_pinky/sdram_configs.c
index a58c6dd3d3..359375830c 100644
--- a/src/mainboard/google/veyron_pinky/sdram_configs.c
+++ b/src/mainboard/google/veyron_pinky/sdram_configs.c
@@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <arch/io.h>
+#include <boardid.h>
#include <console/console.h>
#include <gpio.h>
#include <soc/sdram.h>
@@ -42,31 +43,9 @@ static struct rk3288_sdram_params sdram_configs[] = {
#include "sdram_inf/sdram-unused.inc" /* ram_code = 1111 */
};
-#define GPIO_RAMCODE0 GPIO(8, A, 0)
-#define GPIO_RAMCODE1 GPIO(8, A, 1)
-#define GPIO_RAMCODE2 GPIO(8, A, 2)
-#define GPIO_RAMCODE3 GPIO(8, A, 3)
-
-u32 sdram_get_ram_code(void)
-{
- u32 code = 0;
-
- gpio_input(GPIO_RAMCODE0);
- gpio_input(GPIO_RAMCODE1);
- gpio_input(GPIO_RAMCODE2);
- gpio_input(GPIO_RAMCODE3);
-
- code = gpio_get(GPIO_RAMCODE3) << 3
- | gpio_get(GPIO_RAMCODE2) << 2
- | gpio_get(GPIO_RAMCODE1) << 1
- | gpio_get(GPIO_RAMCODE0) << 0;
-
- return code;
-}
-
const struct rk3288_sdram_params *get_sdram_config()
{
- u32 ramcode = sdram_get_ram_code();
+ u32 ramcode = ram_code();
if (ramcode >= ARRAY_SIZE(sdram_configs)
|| sdram_configs[ramcode].dramtype == UNUSED)