Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google Inc. |
| 5 | * Copyright (C) 2013 Sage Electronic Engineering, LLC. |
York Yang | 4a91f64 | 2014-11-25 15:54:08 -0700 | [diff] [blame] | 6 | * Copyright (C) 2014 Intel Corporation |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 16 | */ |
| 17 | |
Ben Gardner | fa6014a | 2015-12-08 21:20:25 -0600 | [diff] [blame] | 18 | #include <soc/romstage.h> |
Marc Jones | 7868797 | 2015-04-22 23:16:31 -0600 | [diff] [blame] | 19 | #include <drivers/intel/fsp1_0/fsp_util.h> |
Martin Roth | 14ca52b | 2014-12-02 21:51:03 -0700 | [diff] [blame] | 20 | #include <pc80/mc146818rtc.h> |
| 21 | #include <console/console.h> |
Ben Gardner | fa6014a | 2015-12-08 21:20:25 -0600 | [diff] [blame] | 22 | #include <soc/gpio.h> |
| 23 | #include <soc/intel/fsp_baytrail/chip.h> |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * /brief mainboard call for setup that needs to be done before fsp init |
| 27 | * |
| 28 | */ |
| 29 | void early_mainboard_romstage_entry() |
| 30 | { |
| 31 | |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Get function disables - most of these will be done automatically |
| 36 | * @param fd_mask |
| 37 | * @param fd2_mask |
| 38 | */ |
| 39 | void get_func_disables(uint32_t *fd_mask, uint32_t *fd2_mask) |
| 40 | { |
| 41 | |
| 42 | } |
| 43 | |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 44 | /** |
| 45 | * /brief mainboard call for setup that needs to be done after fsp init |
| 46 | * |
| 47 | */ |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 48 | void late_mainboard_romstage_entry() |
| 49 | { |
| 50 | |
| 51 | } |
| 52 | |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 53 | void romstage_fsp_rt_buffer_callback(FSP_INIT_RT_BUFFER *FspRtBuffer) |
| 54 | { |
| 55 | UPD_DATA_REGION *UpdData = FspRtBuffer->Common.UpdDataRgnPtr; |
Martin Roth | 14ca52b | 2014-12-02 21:51:03 -0700 | [diff] [blame] | 56 | u8 use_xhci = UpdData->PcdEnableXhci; |
Martin Roth | 9aadeb5 | 2014-12-14 14:12:11 -0700 | [diff] [blame] | 57 | u8 gpio5 = 0; |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 58 | |
York Yang | 4a91f64 | 2014-11-25 15:54:08 -0700 | [diff] [blame] | 59 | /* |
Martin Roth | 9aadeb5 | 2014-12-14 14:12:11 -0700 | [diff] [blame] | 60 | * Minnow Max Board |
| 61 | * Read SSUS gpio 5 to determine memory type |
| 62 | * 0 : 1GB SKU uses 2Gb density memory |
| 63 | * 1 : 2GB SKU uses 4Gb density memory |
York Yang | 4a91f64 | 2014-11-25 15:54:08 -0700 | [diff] [blame] | 64 | * |
Martin Roth | 9aadeb5 | 2014-12-14 14:12:11 -0700 | [diff] [blame] | 65 | * devicetree.cb assumes 1GB SKU board |
| 66 | */ |
| 67 | configure_ssus_gpio(5, PAD_FUNC0 | PAD_PULL_DISABLE, PAD_VAL_INPUT); |
| 68 | gpio5 = read_ssus_gpio(5); |
| 69 | if (gpio5) |
York Yang | 4a91f64 | 2014-11-25 15:54:08 -0700 | [diff] [blame] | 70 | UpdData->PcdMemoryParameters.DIMMDensity |
| 71 | += (DIMM_DENSITY_4G_BIT - DIMM_DENSITY_2G_BIT); |
Martin Roth | 9aadeb5 | 2014-12-14 14:12:11 -0700 | [diff] [blame] | 72 | printk(BIOS_NOTICE, "%s GB Minnowboard Max detected.\n", |
| 73 | gpio5 ? "2 / 4" : "1" ); |
Martin Roth | 14ca52b | 2014-12-02 21:51:03 -0700 | [diff] [blame] | 74 | /* Update XHCI UPD value if required */ |
| 75 | get_option(&use_xhci, "use_xhci_over_ehci"); |
| 76 | if ((use_xhci < 2) && (use_xhci != UpdData->PcdEnableXhci)) { |
| 77 | UpdData->PcdEnableXhci = use_xhci; |
| 78 | printk(FSP_INFO_LEVEL, "Xhci updated from CMOS:\t\t\t%s\n", |
| 79 | UpdData->PcdEnableXhci?"Enabled":"Disabled"); |
| 80 | } |
| 81 | |
Martin Roth | e6df041 | 2014-07-28 14:22:32 -0600 | [diff] [blame] | 82 | return; |
| 83 | } |