the following patch was just integrated into master:
commit 130aafacb0998bddef222f1a4ae6e44003433279
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Tue Apr 16 16:00:23 2013 -0700
Samsung/exynos5250: convert unsigned {int,char} to u32/u8
The types are (esp. int) are confusing at times as to size.
Make them definite as to size.
Change-Id: Id7808f1f61649ec0a3403c1afc3c2c3d4302b7fb
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
Reviewed-on: http://review.coreboot.org/3103
Tested-by: build bot (Jenkins)
Reviewed-by: Gabe Black <gabeblack(a)chromium.org>
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
Build-Tested: build bot (Jenkins) at Wed Apr 17 01:27:23 2013, giving +1
Reviewed-By: David Hendricks <dhendrix(a)chromium.org> at Wed Apr 17 02:28:13 2013, giving +2
See http://review.coreboot.org/3103 for details.
-gerrit
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3079
-gerrit
commit a61dd9d4ec29ac862d2fe5462b030e4761002444
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Fri Apr 12 15:11:05 2013 -0700
armv7/exynos5250: Deprecate sdelay in favor of udelay
This gets rid of the clock-tick based sdelay in favor of udelay().
udelay() is more consistent and easier to work with, and this allows
us to carry one less variation of timers (and headers and sources...).
Every 1 unit in the sdelay() argument was assumed to cause a delay of
2 clock ticks (@1.7GHz). So the conversion factor is roughly:
sdelay(N) = udelay(((N * 2) / 1.7 * 10^9) * 10^6)
= udelay((N * 2) / (1.7 * 10^3))
The sdelay() periods used were:
sdelay(100) --> udelay(1)
sdelay(0x10000) --> udelay(78) (rounded up to udelay(100))
There was one instance of sdelay(10000), which looked like sort of a
typo since sdelay(0x10000) was used elsewhere. sdelay(10000) should
approximate to about 12us, so we'll stick with that for now and leave
a note.
Change-Id: I5e7407865ceafa701eea1d613bbe50cf4734f33e
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
---
src/arch/armv7/bootblock.inc | 2 --
src/arch/armv7/include/system.h | 26 --------------------
src/arch/armv7/lib/Makefile.inc | 1 -
src/arch/armv7/lib/syslib.c | 39 ------------------------------
src/cpu/armltd/cortex-a9/cache.c | 1 -
src/cpu/samsung/exynos5250/clock_init.c | 1 -
src/cpu/samsung/exynos5250/dmc_common.c | 23 +++++++++++-------
src/cpu/samsung/exynos5250/dmc_init_ddr3.c | 7 ++++--
8 files changed, 19 insertions(+), 81 deletions(-)
diff --git a/src/arch/armv7/bootblock.inc b/src/arch/armv7/bootblock.inc
index 8db31b4..bac32e2 100644
--- a/src/arch/armv7/bootblock.inc
+++ b/src/arch/armv7/bootblock.inc
@@ -29,8 +29,6 @@
* MA 02111-1307 USA
*/
-#include <system.h>
-
.section ".bl1", "a", %progbits
_bl1:
/* For now we have to live with a first stage boot loader
diff --git a/src/arch/armv7/include/system.h b/src/arch/armv7/include/system.h
deleted file mode 100644
index 0643852..0000000
--- a/src/arch/armv7/include/system.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* FIXME(dhendrix): This is split out from asm/system.h. */
-#ifndef SYSTEM_H_
-#define SYSTEM_H_
-
-/*
- * This is used to ensure the compiler did actually allocate the register we
- * asked it for some inline assembly sequences. Apparently we can't trust
- * the compiler from one version to another so a bit of paranoia won't hurt.
- * This string is meant to be concatenated with the inline asm string and
- * will cause compilation to stop on mismatch.
- * (for details, see gcc PR 15089)
- */
-#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
-
-#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
-
-#define arch_align_stack(x) (x)
-
-#ifndef __ASSEMBLER__
- /*
- * FIXME: sdelay originally came from arch/arm/cpu/armv7/exynos5/setup.h in
- * u-boot but does not seem specific to exynos5...
- */
-void sdelay(unsigned long loops);
-#endif // __ASSEMBLY__
-#endif /* SYSTEM_H_ */
diff --git a/src/arch/armv7/lib/Makefile.inc b/src/arch/armv7/lib/Makefile.inc
index 0cb5737..b10c1ab 100644
--- a/src/arch/armv7/lib/Makefile.inc
+++ b/src/arch/armv7/lib/Makefile.inc
@@ -5,7 +5,6 @@ bootblock-y += cache.c
romstage-y += cache.c
romstage-y += div0.c
-romstage-y += syslib.c
romstage-$(CONFIG_EARLY_CONSOLE) += early_console.c
ramstage-y += div0.c
diff --git a/src/arch/armv7/lib/syslib.c b/src/arch/armv7/lib/syslib.c
deleted file mode 100644
index a6ed080..0000000
--- a/src/arch/armv7/lib/syslib.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * (C) Copyright 2008
- * Texas Instruments, <www.ti.com>
- *
- * Richard Woodruff <r-woodruff2(a)ti.com>
- * Syed Mohammed Khasim <khasim(a)ti.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <arch/io.h>
-#include <system.h> /* FIXME: dumping ground for prototypes */
-
-/************************************************************
- * sdelay() - simple spin loop. Will be constant time as
- * its generally used in bypass conditions only. This
- * is necessary until timers are accessible.
- *
- * not inline to increase chances its in cache when called
- *************************************************************/
-void sdelay(unsigned long loops)
-{
- __asm__ volatile ("1:\n" "subs %0, %1, #1\n"
- "bne 1b":"=r" (loops):"0"(loops));
-}
-
diff --git a/src/cpu/armltd/cortex-a9/cache.c b/src/cpu/armltd/cortex-a9/cache.c
index 957871d..4f440ec 100644
--- a/src/cpu/armltd/cortex-a9/cache.c
+++ b/src/cpu/armltd/cortex-a9/cache.c
@@ -12,7 +12,6 @@
*/
#include <common.h>
-#include <system.h>
#include <armv7.h>
/*
diff --git a/src/cpu/samsung/exynos5250/clock_init.c b/src/cpu/samsung/exynos5250/clock_init.c
index c8479de..c94cadf 100644
--- a/src/cpu/samsung/exynos5250/clock_init.c
+++ b/src/cpu/samsung/exynos5250/clock_init.c
@@ -25,7 +25,6 @@
#include <delay.h>
#include <stdlib.h>
#include <types.h>
-#include <system.h>
#include <console/console.h>
diff --git a/src/cpu/samsung/exynos5250/dmc_common.c b/src/cpu/samsung/exynos5250/dmc_common.c
index 8c4b583..bcfc9fe 100644
--- a/src/cpu/samsung/exynos5250/dmc_common.c
+++ b/src/cpu/samsung/exynos5250/dmc_common.c
@@ -24,12 +24,11 @@
#include <arch/io.h>
#include <assert.h>
-#include <common.h>
+#include <delay.h>
#include <console/console.h>
#include <cpu/samsung/exynos5250/setup.h>
#include <cpu/samsung/exynos5250/dmc.h>
#include <cpu/samsung/exynos5250/clock_init.h>
-#include <system.h>
#include "clock_init.h"
#include "setup.h"
@@ -75,7 +74,7 @@ int dmc_config_zq(struct mem_timings *mem,
*/
i = ZQ_INIT_TIMEOUT;
while ((readl(&phy0_ctrl->phy_con17) & ZQ_DONE) != ZQ_DONE && i > 0) {
- sdelay(100);
+ udelay(1);
i--;
}
if (!i)
@@ -84,7 +83,7 @@ int dmc_config_zq(struct mem_timings *mem,
i = ZQ_INIT_TIMEOUT;
while ((readl(&phy1_ctrl->phy_con17) & ZQ_DONE) != ZQ_DONE && i > 0) {
- sdelay(100);
+ udelay(1);
i--;
}
if (!i)
@@ -135,21 +134,27 @@ void dmc_config_mrs(struct mem_timings *mem, struct exynos5_dmc *dmc)
* delays? This one and the next were not there for
* DDR3.
*/
- sdelay(0x10000);
+ udelay(100);
/* Sending EMRS/MRS commands */
for (i = 0; i < MEM_TIMINGS_MSR_COUNT; i++) {
writel(mem->direct_cmd_msr[i] | mask,
&dmc->directcmd);
- sdelay(0x10000);
+ udelay(100);
}
if (mem->send_zq_init) {
/* Sending ZQINIT command */
writel(DIRECT_CMD_ZQINIT | mask,
&dmc->directcmd);
-
- sdelay(10000);
+ /*
+ * FIXME: This was originally sdelay(10000)
+ * in the imported u-boot code. That may have
+ * been meant to be sdelay(0x10000) since that
+ * was used elsewhere in this function. Either
+ * way seems to work, though.
+ */
+ udelay(12);
}
}
}
@@ -168,7 +173,7 @@ void dmc_config_prech(struct mem_timings *mem, struct exynos5_dmc *dmc)
/* PALL (all banks precharge) CMD */
writel(DIRECT_CMD_PALL | mask, &dmc->directcmd);
- sdelay(0x10000);
+ udelay(100);
}
}
}
diff --git a/src/cpu/samsung/exynos5250/dmc_init_ddr3.c b/src/cpu/samsung/exynos5250/dmc_init_ddr3.c
index 9a4ead0..5bb8a37 100644
--- a/src/cpu/samsung/exynos5250/dmc_init_ddr3.c
+++ b/src/cpu/samsung/exynos5250/dmc_init_ddr3.c
@@ -23,12 +23,12 @@
*/
#include <config.h>
+#include <delay.h>
#include <arch/io.h>
#include <console/console.h>
//#include "clock.h"
/* FIXME(dhendrix): untangle clock/clk ... */
#include <cpu/samsung/exynos5-common/clock.h>
-#include <system.h>
#include "clk.h"
#include "cpu.h"
#include "dmc.h"
@@ -44,6 +44,7 @@ static void reset_phy_ctrl(void)
writel(LPDDR3PHY_CTRL_PHY_RESET_OFF, &clk->lpddr3phy_ctrl);
writel(LPDDR3PHY_CTRL_PHY_RESET, &clk->lpddr3phy_ctrl);
+#if 0
/*
* For proper memory initialization there should be a minimum delay of
* 500us after the LPDDR3PHY_CTRL_PHY_RESET signal.
@@ -56,6 +57,8 @@ static void reset_phy_ctrl(void)
* TODO(hatim.rv(a)samsung.com): Implement the delay using timer/counter
*/
sdelay(425000);
+#endif
+ udelay(500);
}
int ddr3_mem_ctrl_init(struct mem_timings *mem, unsigned long mem_iv_size)
@@ -236,7 +239,7 @@ int ddr3_mem_ctrl_init(struct mem_timings *mem, unsigned long mem_iv_size)
* TODO(waihong): Comment on how long this take to
* timeout
*/
- sdelay(100);
+ udelay(1);
i--;
}
if (!i){
the following patch was just integrated into master:
commit 88d0c7330e1a10d621e331398a041458d1c940b2
Author: Siyuan Wang <wangsiyuanbuaa(a)gmail.com>
Date: Tue Apr 16 13:59:37 2013 +0800
AMD Parmer: remove unused macros and turn off unused pcie port
1) The macros GNB_GPP_PORTx_PORT_PRESENT, GNB_GPP_PORTx_SPEED_MODE,
GNB_GPP_PORTx_LINK_ASPM and GNB_GPP_PORTx_CHANNEL_TYPE are not used.
This is based on >AMD Thatcher: remove unused macros in PlatformGnbPcieComplex.h< [1].
2) Disable unused PCIE port in devicetree.cb.
PCIE port 3 is not used in Parmer.
This is based on item 3 of >AMD Thatcher: Fix PCIE link issues< [2].
[1] http://review.coreboot.org/#/c/3087/
[2] http://review.coreboot.org/#/c/3011/
Change-Id: Id6f00d5e77ce5133d9ef3db07f95ad03a59e061a
Signed-off-by: Siyuan Wang <SiYuan.Wang(a)amd.com>
Signed-off-by: Siyuan Wang <wangsiyuanbuaa(a)gmail.com>
Reviewed-on: http://review.coreboot.org/3099
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Build-Tested: build bot (Jenkins) at Tue Apr 16 13:01:53 2013, giving +1
Reviewed-By: Ronald G. Minnich <rminnich(a)gmail.com> at Tue Apr 16 17:49:04 2013, giving +2
See http://review.coreboot.org/3099 for details.
-gerrit
the following patch was just integrated into master:
commit 8d9ffd93b59781299bb2ed06d7f9ad30c7aac41b
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sat Apr 13 18:25:56 2013 +0200
cbmem: map_memory: Use length modifier `j` and cast for an `off_t` argument
cbmem currently fails to build due to `-Werror` and the following
warning.
$ make
cc -O2 -Wall -Werror -iquote ../../src/include -iquote ../../src/src/arch/x86 -c -o cbmem.o cbmem.c
cbmem.c: In function ‘map_memory’:
cbmem.c:87:2: error: format ‘%zx’ expects argument of type ‘size_t’, but argument 2 has type ‘off_t’ [-Werror=format]
[…]
Casting the argument of type `off_t` to `intmax_t` and using the
length modifier `j`
$ man 3 printf
[…]
j A following integer conversion corresponds to an intmax_t or uintmax_t argument.
[…]
instead of `z` as suggested in [1] and confirmed by stefanct and
segher in #coreboot on <irc.freenode.net>, gets rid of this warning
and should work an 32-bit and 64-bit systems, as an `off_t` fits
into `intmax_t`.
[1] http://www.pixelbeat.org/programming/gcc/int_types/
Change-Id: I1360abbc47aa1662e1edfbe337cf7911695c532f
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3083
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Build-Tested: build bot (Jenkins) at Tue Apr 16 14:22:55 2013, giving +1
Reviewed-By: Ronald G. Minnich <rminnich(a)gmail.com> at Tue Apr 16 17:46:23 2013, giving +2
See http://review.coreboot.org/3083 for details.
-gerrit
the following patch was just integrated into master:
commit 8c937c7e3cb9768c83e49a445f13e87a58d79768
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Tue Mar 12 15:53:44 2013 +0100
Intel Panther Point PCH: Use 2 << 24 to clarify that APIC ID is 2
Commit »Add support for Intel Panther Point PCH« (8e073829) [1] used
`1 << 25` to set the APIC ID of 2. Using `2 << 24`, which is the same
value, instead makes it clear, that the APIC ID is 2.
[1] http://review.coreboot.org/853
Change-Id: I5044dc470120cde2d2cdfc6e9ead17ddb47b6453
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3100
Reviewed-by: Patrick Georgi <patrick(a)georgi-clan.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones(a)se-eng.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Tue Apr 16 12:51:19 2013, giving +2
Build-Tested: build bot (Jenkins) at Tue Apr 16 14:57:21 2013, giving +1
Reviewed-By: Marc Jones <marc.jones(a)se-eng.com> at Tue Apr 16 15:34:09 2013, giving +2
See http://review.coreboot.org/3100 for details.
-gerrit
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3101
-gerrit
commit 9c212029eeb1f830ab8716ebff5da3517ce5a8e4
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Tue Apr 16 13:09:40 2013 +0200
AMD CIMx SB800: Kconfig: Add more information about SATA modes
At least the Linux kernel is setting up the SATA controller to AHCI
mode even if coreboot sets it to IDE (NATIVE) mode.
$ dmesg
[…]
[ 0.172251] pci 0000:00:11.0: [1002:4390] type 0 class 0x000101
[ 0.172279] pci 0000:00:11.0: reg 10: [io 0x1410-0x1417]
[ 0.172294] pci 0000:00:11.0: reg 14: [io 0x1420-0x1423]
[ 0.172309] pci 0000:00:11.0: reg 18: [io 0x1418-0x141f]
[ 0.172323] pci 0000:00:11.0: reg 1c: [io 0x1424-0x1427]
[ 0.172338] pci 0000:00:11.0: reg 20: [io 0x1400-0x140f]
[ 0.172353] pci 0000:00:11.0: reg 24: [mem 0xf004b000-0xf004b3ff]
[ 0.172382] pci 0000:00:11.0: set SATA to AHCI mode
[…]
[ 1.127727] calling ahci_init+0x0/0x1000 [ahci] @ 72
[ 1.177072] ahci 0000:00:11.0: version 3.0
[ 1.177353] ahci 0000:00:11.0: AHCI 0001.0200 32 slots 6 ports 6 Gbps 0x3f impl SATA mode
[ 1.177360] ahci 0000:00:11.0: flags: 64bit ncq sntf ilck led clo pmp pio slum part
[ 1.179783] scsi0 : ahci
[ 1.180073] scsi1 : ahci
[ 1.180228] scsi2 : ahci
[ 1.180406] scsi3 : ahci
[ 1.180525] scsi4 : ahci
[ 1.180917] scsi5 : ahci
[ 1.181208] ata1: SATA max UDMA/133 abar m1024@0xf004b000 port 0xf004b100 irq 19
[ 1.181215] ata2: SATA max UDMA/133 abar m1024@0xf004b000 port 0xf004b180 irq 19
[ 1.181221] ata3: SATA max UDMA/133 abar m1024@0xf004b000 port 0xf004b200 irq 19
[ 1.181226] ata4: SATA max UDMA/133 abar m1024@0xf004b000 port 0xf004b280 irq 19
[ 1.181232] ata5: SATA max UDMA/133 abar m1024@0xf004b000 port 0xf004b300 irq 19
[ 1.181238] ata6: SATA max UDMA/133 abar m1024@0xf004b000 port 0xf004b380 irq 19
[ 1.181366] initcall ahci_init+0x0/0x1000 [ahci] returned 0 after 52315 usecs
[…]
$ lspci -vvv
[…]
00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 SATA Controller [IDE mode] (rev 40) (prog-if 01 [AHCI 1.0])
[…]
Clarify the above in the Kconfig description.
Change-Id: I5b2b8d4de42d44db5d36aaace16b1c534a0c17ec
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/southbridge/amd/cimx/sb800/Kconfig | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/southbridge/amd/cimx/sb800/Kconfig b/src/southbridge/amd/cimx/sb800/Kconfig
index 554d8c7..0555ad5 100644
--- a/src/southbridge/amd/cimx/sb800/Kconfig
+++ b/src/southbridge/amd/cimx/sb800/Kconfig
@@ -48,8 +48,11 @@ choice
prompt "SATA Mode"
default SB800_SATA_AHCI
help
- Select the mode in which SATA should be driven. NATIVE AHCI, or RAID.
- The default is AHCI.
+ Select the mode in which the SATA controller should be driven: NATIVE, AHCI, or RAID.
+
+ Note that most operating systems are going to set up the SATA controller to AHCI mode even when configured to NATIVE mode. So the only difference in user experience is going to be during the payload phase.
+
+ The default mode is AHCI.
config SB800_SATA_IDE
bool "NATIVE"