From: Alexander Stein <alexanders83@web.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/6] ARM: bcm283x: Allocate all mailbox buffers cacheline aligned
Date: Mon, 20 Jul 2015 23:00:02 +0200 [thread overview]
Message-ID: <1437426004-22549-5-git-send-email-alexanders83@web.de> (raw)
In-Reply-To: <1437426004-22549-1-git-send-email-alexanders83@web.de>
The mailbox buffer is required to be at least 16 bytes aligned, but for
cache invalidation and/or flush it needs to be cacheline aligned.
Use CONFIG_SYS_CACHELINE_SIZE alignment for all mailbox buffer allocations.
Signed-off-by: Alexander Stein <alexanders83@web.de>
---
board/raspberrypi/rpi/rpi.c | 10 +++++-----
drivers/video/bcm2835.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 96fe870..d5d3fec 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -182,7 +182,7 @@ u32 rpi_board_rev = 0;
int dram_init(void)
{
- ALLOC_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1, 16);
+ ALLOC_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1, CONFIG_SYS_CACHELINE_SIZE);
int ret;
BCM2835_MBOX_INIT_HDR(msg);
@@ -212,7 +212,7 @@ static void set_fdtfile(void)
static void set_usbethaddr(void)
{
- ALLOC_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1, 16);
+ ALLOC_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1, CONFIG_SYS_CACHELINE_SIZE);
int ret;
if (!models[rpi_board_rev].has_onboard_eth)
@@ -245,7 +245,7 @@ int misc_init_r(void)
static int power_on_module(u32 module)
{
- ALLOC_ALIGN_BUFFER(struct msg_set_power_state, msg_pwr, 1, 16);
+ ALLOC_ALIGN_BUFFER(struct msg_set_power_state, msg_pwr, 1, CONFIG_SYS_CACHELINE_SIZE);
int ret;
BCM2835_MBOX_INIT_HDR(msg_pwr);
@@ -269,7 +269,7 @@ static int power_on_module(u32 module)
static void get_board_rev(void)
{
- ALLOC_ALIGN_BUFFER(struct msg_get_board_rev, msg, 1, 16);
+ ALLOC_ALIGN_BUFFER(struct msg_get_board_rev, msg, 1, CONFIG_SYS_CACHELINE_SIZE);
int ret;
const char *name;
@@ -324,7 +324,7 @@ int board_init(void)
int board_mmc_init(bd_t *bis)
{
- ALLOC_ALIGN_BUFFER(struct msg_get_clock_rate, msg_clk, 1, 16);
+ ALLOC_ALIGN_BUFFER(struct msg_get_clock_rate, msg_clk, 1, CONFIG_SYS_CACHELINE_SIZE);
int ret;
power_on_module(BCM2835_MBOX_POWER_DEVID_SDHCI);
diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
index 1f18231..30e22cc 100644
--- a/drivers/video/bcm2835.c
+++ b/drivers/video/bcm2835.c
@@ -38,8 +38,8 @@ struct msg_setup {
void lcd_ctrl_init(void *lcdbase)
{
- ALLOC_ALIGN_BUFFER(struct msg_query, msg_query, 1, 16);
- ALLOC_ALIGN_BUFFER(struct msg_setup, msg_setup, 1, 16);
+ ALLOC_ALIGN_BUFFER(struct msg_query, msg_query, 1, CONFIG_SYS_CACHELINE_SIZE);
+ ALLOC_ALIGN_BUFFER(struct msg_setup, msg_setup, 1, CONFIG_SYS_CACHELINE_SIZE);
int ret;
u32 w, h;
--
2.4.6
next prev parent reply other threads:[~2015-07-20 21:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 20:59 [U-Boot] [PATCH v2 0/6] dcache support for Raspberry Pi 1 Alexander Stein
2015-07-20 20:59 ` [U-Boot] [PATCH v2 1/6] arm1136: Remove dead code Alexander Stein
2015-07-20 21:00 ` [U-Boot] [PATCH v2 2/6] arm1136/arm1176: Merge cache handling code Alexander Stein
2015-07-20 21:00 ` [U-Boot] [PATCH v2 3/6] ARM: bcm283x: Define CONFIG_SYS_CACHELINE_SIZE Alexander Stein
2015-07-20 21:00 ` Alexander Stein [this message]
2015-07-20 21:00 ` [U-Boot] [PATCH v2 5/6] arm/mach-bcm283x/mbox: Flush and invalidate dcache when using fw mailbox Alexander Stein
2015-07-20 21:00 ` [U-Boot] [PATCH v2 6/6] arm/rpi: Enable dcache Alexander Stein
2015-07-21 21:21 ` Alexander Stein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437426004-22549-5-git-send-email-alexanders83@web.de \
--to=alexanders83@web.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox