Re: [PATCHi v2] i2c-omap: fix am33xx and omap3 fclk_rate

2013-08-31 Thread Sascha Hauer
On Fri, Aug 30, 2013 at 02:45:32PM +0200, Jan Weitzel wrote:
 commit f64ed12b accidentally swap fclk_rate from am33xx and omap3.
 Revert this change.
 
 Signed-off-by: Jan Weitzel j.weit...@phytec.de

Applied, thanks

Sascha

 ---
 v2:
 Fix also omap3 fclk_rate
 Rename patch i2c-omap: fix am33xx fclk_rate
 
  drivers/i2c/busses/i2c-omap.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index b2a74c0..2eb5133 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -246,7 +246,7 @@ struct omap_i2c_driver_data {
  static struct omap_i2c_driver_data omap3_data = {
   .flags =OMAP_I2C_FLAG_RESET_REGS_POSTIDLE |
   OMAP_I2C_FLAG_BUS_SHIFT_2,
 - .fclk_rate =48000,
 + .fclk_rate =96000,
   .regs = (u8 *) reg_map,
  };
  
 @@ -259,7 +259,7 @@ static struct omap_i2c_driver_data omap4_data = {
  static struct omap_i2c_driver_data am33xx_data = {
   .flags =OMAP_I2C_FLAG_RESET_REGS_POSTIDLE |
   OMAP_I2C_FLAG_BUS_SHIFT_NONE,
 - .fclk_rate =96000,
 + .fclk_rate =48000,
   .regs = (u8 *) omap4_reg_map,
  };
  
 -- 
 1.7.0.4
 
 
 ___
 barebox mailing list
 barebox@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/barebox
 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 1/1] arm: mmu: catch NULL pointer dereferences

2013-08-31 Thread Jean-Christophe PLAGNIOL-VILLARD
For high vectors if memory start at 0x0. We have to
live without being able to catch NULL pointer dereferences.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
---
 arch/arm/cpu/mmu.c | 27 +--
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index e3ea3b6..2e69b16 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -218,9 +218,9 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank)
 /*
  * Map vectors and zero page
  */
-static void vectors_init(void)
+static void vectors_init(bool zero_valid_addr)
 {
-   u32 *exc, *zero = NULL;
+   u32 *exc;
void *vectors;
u32 cr;
 
@@ -235,10 +235,19 @@ static void vectors_init(void)
 * page table for the high vectors and zero page
 */
exc = arm_create_pte(0xfff0);
-   zero = arm_create_pte(0x0);
 
-   /* Set the zero page to faulting */
-   zero[0] = 0;
+   /*
+* Memory start at 0x0. We have to
+* live without being able to catch NULL pointer dereferences
+*/
+   if (!zero_valid_addr) {
+   u32 *zero = NULL;
+
+   zero = arm_create_pte(0x0);
+
+   /* Set the zero page to faulting */
+   zero[0] = 0;
+   }
} else {
/*
 * Otherwise map the vectors to the zero page. We have to
@@ -267,6 +276,7 @@ static int mmu_init(void)
 {
struct memory_bank *bank;
int i;
+   bool is_start_zero = 0;
 
arm_set_cache_functions();
 
@@ -303,7 +313,12 @@ static int mmu_init(void)
create_sections(0, 0, PAGE_SIZE, PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
PMD_TYPE_SECT);
 
-   vectors_init();
+   for_each_memory_bank(bank) {
+   if (bank-start == 0x0)
+   is_start_zero = 1;
+   }
+
+   vectors_init(is_start_zero);
 
/*
 * First remap sdram cached using sections.
-- 
1.8.4.rc1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox