aboutsummaryrefslogtreecommitdiff
path: root/src/soc/samsung/exynos5250/usb.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2013-12-09 17:46:22 -0800
committerIsaac Christensen <isaac.christensen@se-eng.com>2014-09-22 18:42:20 +0200
commit03784fa97a764be81ca9bcf79222e7b37e2e7692 (patch)
tree600c7de6cf1c27c3f117bf80bcd52c9e36785faa /src/soc/samsung/exynos5250/usb.h
parentc505837e67aa4fb89964c849d905fa8d44459152 (diff)
Add check_member macro to allow clean and easy struct offset checking
This patch adds a new static assertion macro that can be used to check the offsets in structures that overlay register sets at compile time. It uses the _Static_assert() declaration from the new ISO C11 standard, which is supported (even without -std=c11) by GCC after version 4.6. (There is supposedly also support in clang, although I haven't tried it... let's deal with compiler issues when/if they turn up.) I've added it to all structures for our current ARM SoCs for now, and I think every new register overlay we add going forward should use them (at least for the last member, but feel free to add more if you think it's useful). Change-Id: If32510e7049739ad05618d363a854dc372d64386 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179412 Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> (cherry picked from commit cef5fa13c31375a316ca4556c0039b17c8ea7900) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6905 Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/samsung/exynos5250/usb.h')
-rw-r--r--src/soc/samsung/exynos5250/usb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/soc/samsung/exynos5250/usb.h b/src/soc/samsung/exynos5250/usb.h
index ad617da96c..20a22571a2 100644
--- a/src/soc/samsung/exynos5250/usb.h
+++ b/src/soc/samsung/exynos5250/usb.h
@@ -58,6 +58,7 @@ struct exynos5_usb_host_phy {
uint8_t reserved4[4];
uint32_t usbotgtune;
};
+check_member(exynos5_usb_host_phy, usbotgtune, 0x40);
static struct exynos5_usb_host_phy * const exynos_usb_host_phy =
(void *)EXYNOS5_USB_HOST_PHY_BASE;
@@ -81,6 +82,7 @@ struct exynos5_usb_drd_phy {
uint32_t linkhcbelt;
uint32_t linkport;
};
+check_member(exynos5_usb_drd_phy, linkport, 0x44);
static struct exynos5_usb_drd_phy * const exynos_usb_drd_phy =
(void *)EXYNOS5_USB_DRD_PHY_BASE;
@@ -121,6 +123,7 @@ struct exynos5_usb_drd_dwc3 {
uint32_t usb3pipectl;
uint8_t reserved6[60];
};
+check_member(exynos5_usb_drd_dwc3, usb3pipectl, 0x1c0);
static struct exynos5_usb_drd_dwc3 * const exynos_usb_drd_dwc3 =
(void *)EXYNOS5_USB_DRD_DWC3_BASE;