Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6267
-gerrit
commit 166aa70c5980284c17271c44e021811546626fd9
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sat Jul 12 19:59:31 2014 +1000
southbridge/intel/bd82x6x/early_smbus.c: Use 'pci_devfn_t'
Straighten out typedef usage between 'pci_devfn_t' vs. 'device_t' with
the aim to deprecate one version of 'device_t' various typedefs.
Change-Id: I5cdd61292925ec2c5d42969cf6a118c9c49bbcb4
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/southbridge/intel/bd82x6x/early_smbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/southbridge/intel/bd82x6x/early_smbus.c b/src/southbridge/intel/bd82x6x/early_smbus.c
index 616e7c3..9105cba 100644
--- a/src/southbridge/intel/bd82x6x/early_smbus.c
+++ b/src/southbridge/intel/bd82x6x/early_smbus.c
@@ -27,7 +27,7 @@
void enable_smbus(void)
{
- device_t dev;
+ pci_devfn_t dev;
/* Set the SMBus device statically. */
dev = PCI_DEV(0x0, 0x1f, 0x3);
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6232
-gerrit
commit b4b1b586c9e5038644934a0c1e00599cab403b00
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Thu Jul 10 02:49:54 2014 +1000
NOTFORMERGE: test
Change-Id: Icb2eca566a96b723a3162983aac57394e6a866d3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/arch/x86/include/arch/io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index d5cdf35..4ae9fe2 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -224,7 +224,7 @@ static inline int log2f(int value)
/* FIXME: Sources for romstage still use device_t. */
/* Use pci_devfn_t or pnp_devfn_t instead */
-typedef u32 device_t;
+//typedef u32 device_t;
/* FIXME: We need to make the coreboot to run at 64bit mode, So when read/write memory above 4G,
* We don't need to set %fs, and %gs anymore
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6225
-gerrit
commit 93806cc15cd88defa8fc3025f73771dd8faf5961
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Wed Jul 9 04:55:16 2014 +1000
device/pci_early.c: Mixes up variants of a typedefs to 'u32'
Unfortunately coreboot has to deal with ROMCC's short comings which has
lead to a little bit of confusion due to typedefs. Essentially, coreboot
defines four typedefs:
* 'typedef struct device * device_t' in ramstage not in SIMPLE_DEVICE mode
* 'typedef u32 device_t' in romstage or when SIMPLE_DEVICE is defined
* 'typedef u32 pnp_devfn_t'
* 'typedef u32 pci_devfn_t'
Some early functions make use of 'device_t' over 'pci_devfn_t' and since
the C type-checker does not enforce typedefs to the same type 'u32'
these are never noticed. Fix these so that 'device_t' does not conflict
in romstage for later work. We later plan to have 'pnp_devfn_t' and
'pci_devfn_t' as the only variants of 'u32' and 'device_t' to be a
struct pointer type exclusively.
Change-Id: I948801f5be968a934798f1bad7722649758cd4d3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/device/pci_early.c | 7 +++----
src/include/device/pci.h | 6 ++++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/device/pci_early.c b/src/device/pci_early.c
index e31287e..e690211 100644
--- a/src/device/pci_early.c
+++ b/src/device/pci_early.c
@@ -25,8 +25,7 @@
#include <delay.h>
#ifdef __PRE_RAM__
-
-unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last)
+unsigned pci_find_next_capability(pci_devfn_t dev, unsigned cap, unsigned last)
{
unsigned pos = 0;
u16 status;
@@ -69,11 +68,11 @@ unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last)
return 0;
}
-unsigned pci_find_capability(device_t dev, unsigned cap)
+unsigned pci_find_capability(pci_devfn_t dev, unsigned cap)
{
return pci_find_next_capability(dev, cap, 0);
}
-#endif
+#endif /* __PRE_RAM__ */
#if CONFIG_EARLY_PCI_BRIDGE
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index 8175970..0670da4 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -102,8 +102,14 @@ static inline const struct pci_operations *ops_pci(device_t dev)
#endif /* ! __SIMPLE_DEVICE__ */
+#ifdef __PRE_RAM__
+unsigned pci_find_next_capability(pci_devfn_t dev, unsigned cap, unsigned last);
+unsigned pci_find_capability(pci_devfn_t dev, unsigned cap);
+#else /* !__PRE_RAM__ */
unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last);
unsigned pci_find_capability(device_t dev, unsigned cap);
+#endif /* __PRE_RAM__ */
+
void pci_early_bridge_init(void);
int pci_early_device_probe(u8 bus, u8 dev, u32 mmio_base);
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6232
-gerrit
commit dad2ae4c88d6e04e8e574e1bf80341b7b79e9457
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Thu Jul 10 02:49:54 2014 +1000
NOTFORMERGE: test
Change-Id: Icb2eca566a96b723a3162983aac57394e6a866d3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/arch/x86/include/arch/io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index d5cdf35..4ae9fe2 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -224,7 +224,7 @@ static inline int log2f(int value)
/* FIXME: Sources for romstage still use device_t. */
/* Use pci_devfn_t or pnp_devfn_t instead */
-typedef u32 device_t;
+//typedef u32 device_t;
/* FIXME: We need to make the coreboot to run at 64bit mode, So when read/write memory above 4G,
* We don't need to set %fs, and %gs anymore
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6225
-gerrit
commit a65f867d5a298252d2223b81ba61985267b08dc8
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Wed Jul 9 04:55:16 2014 +1000
device/pci_early.c: Mixes up variants of a typedefs to 'u32'
Unfortunately coreboot has to deal with ROMCC's short comings which has
lead to a little bit of confusion due to typedefs. Essentially, coreboot
defines four typedefs:
* 'typedef struct device * device_t' in ramstage not in SIMPLE_DEVICE mode
* 'typedef u32 device_t' in romstage or when SIMPLE_DEVICE is defined
* 'typedef u32 pnp_devfn_t'
* 'typedef u32 pci_devfn_t'
Some early functions make use of 'device_t' over 'pci_devfn_t' and since
the C type-checker does not enforce typedefs to the same type 'u32'
these are never noticed. Fix these so that 'device_t' does not conflict
in romstage for later work. We later plan to have 'pnp_devfn_t' and
'pci_devfn_t' as the only variants of 'u32' and 'device_t' to be a
struct pointer type exclusively.
Change-Id: I948801f5be968a934798f1bad7722649758cd4d3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/device/pci_early.c | 7 +++----
src/include/device/pci.h | 6 ++++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/device/pci_early.c b/src/device/pci_early.c
index e31287e..e690211 100644
--- a/src/device/pci_early.c
+++ b/src/device/pci_early.c
@@ -25,8 +25,7 @@
#include <delay.h>
#ifdef __PRE_RAM__
-
-unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last)
+unsigned pci_find_next_capability(pci_devfn_t dev, unsigned cap, unsigned last)
{
unsigned pos = 0;
u16 status;
@@ -69,11 +68,11 @@ unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last)
return 0;
}
-unsigned pci_find_capability(device_t dev, unsigned cap)
+unsigned pci_find_capability(pci_devfn_t dev, unsigned cap)
{
return pci_find_next_capability(dev, cap, 0);
}
-#endif
+#endif /* __PRE_RAM__ */
#if CONFIG_EARLY_PCI_BRIDGE
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index 8175970..0670da4 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -102,8 +102,14 @@ static inline const struct pci_operations *ops_pci(device_t dev)
#endif /* ! __SIMPLE_DEVICE__ */
+#ifdef __PRE_RAM__
+unsigned pci_find_next_capability(pci_devfn_t dev, unsigned cap, unsigned last);
+unsigned pci_find_capability(pci_devfn_t dev, unsigned cap);
+#else /* !__PRE_RAM__ */
unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last);
unsigned pci_find_capability(device_t dev, unsigned cap);
+#endif /* __PRE_RAM__ */
+
void pci_early_bridge_init(void);
int pci_early_device_probe(u8 bus, u8 dev, u32 mmio_base);
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6232
-gerrit
commit 1f0d39e25ea707aa7668f8f39763002410fa1e85
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Thu Jul 10 02:49:54 2014 +1000
NOTFORMERGE: test
Change-Id: Icb2eca566a96b723a3162983aac57394e6a866d3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/arch/x86/include/arch/io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index d5cdf35..4ae9fe2 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -224,7 +224,7 @@ static inline int log2f(int value)
/* FIXME: Sources for romstage still use device_t. */
/* Use pci_devfn_t or pnp_devfn_t instead */
-typedef u32 device_t;
+//typedef u32 device_t;
/* FIXME: We need to make the coreboot to run at 64bit mode, So when read/write memory above 4G,
* We don't need to set %fs, and %gs anymore