Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-19 Thread Stefano Babic
On 01/19/2011 09:06 AM, Wolfgang Denk wrote:
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index d7cd09c..3abb4cb 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -554,6 +554,7 @@ Stefano Babic 
>>  ea20davinci
>>  polaris xscale
>>  trizepsiv   xscale
>> +mx35pdk i.MX35
>>  mx51evk i.MX51
>>  vision2 i.MX51
> 
> Please sort list.

Agree.

>> diff --git a/MAKEALL b/MAKEALL
>> index a732e6a..31dbfe1 100755
>> --- a/MAKEALL
>> +++ b/MAKEALL
>> @@ -409,6 +409,7 @@ LIST_ARM11=" \
>>  mx31ads \
>>  mx31pdk \
>>  mx31pdk_nand\
>> +mx35pdk \
>>  qong\
>>  smdk6400\
>>  tnetv107x_evm   \
> 
> NAK.  We don't add boards to MAKEALL any more. They get auto-selcted
> from their entry in boards.cfg.

I missed the point, I wil lfix it.

>> -#define X_ARM_MMU_SECTION(abase, vbase, size, cache, buff, access)  \
>> -{   \
>> -int i; int j = abase; int k = vbase;\
>> -for (i = size; i > 0 ; i--, j++, k++)   \
>> -ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access); \
>> -}
> 
> Here and everywhere else: Macros with multiple statements should be
> enclosed in a do - while block.

The patch removes for mistake this file, that does not really exist in
u-boot. I have aklready fixed it.

>> +CONFIG_SYS_TEXT_BASE = 0xA000
> 
> NAK.  Please move CONFIG_SYS_TEXT_BASE into board config file and
> ditch config.mk

Thanks, I have understood now how it works.

> 
>> +int checkboard(void)
>> +{
>> +u32 system_rev = get_cpu_rev();
>> +u32 board_rev = 0;
>> +struct ccm_regs *ccm =
>> +(struct ccm_regs *)IMX_CCM_BASE;
>> +
>> +puts("Board: MX35 3STACK ");
> 
> Is this the correct board name?

I will change it as MX35PDK

> 
>> +board_rev = board_detect();
>> +
>> +/* Print board revision */
>> +if (board_rev)
>> +puts("2.0");
>> +else
>> +puts("1.0");
> 
> Maybe board_detect() could return the board revision sirectly, so you
> can use a single printf for all this, like:
> 
>   printf("Board: mx35pdk %d.0", board_detect());
> 
> ?
> 
>> +/* Print CPU revision */
>> +puts(" i.MX35 ");
>> +if (system_rev & CHIP_REV_2_0)
>> +puts("2.0 [");
>> +else
>> +puts("1.0 [");
> 
> Eventually something similar could / should be done here?

Yes, this should be (get_cpu_rev() & CHIP_REV_2_0)


> ...
>> +NAND partitions can be recognized enabling in kernel 
>> CONFIG_MTD_REDBOOT_PARTS.
>> +For this board, CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK should be set to 2.
>> +
>> +However, the setup in redboot is not correct and does not use the whole 
>> flash. 
>> +
>> +Better solution is to use the kernel parameter mtdparts. Here the resulting 
>> script to be defined in RedBoot with fconfig:
> 
> Lines too long.  Please fix globally (at least in text).

Ok

> 
> ...
>> +#define CONFIG_EXTRA_ENV_SETTINGS   
>> \
> ...
>> +"uboot=u-boot.bin\0"\
>> +"kernel_addr_r=0x8080\0"\
>> +"kernel=uImage\0"   \
> 
> Default locations are "/u-boot.bin" resp.
> "/uImage".
> 
>> +"prg_uboot=tftpboot ${loadaddr} ${uboot};"  \
>> +"protect off ${uboot_addr} 0xa003;" \
>> +"erase ${uboot_addr} 0xa003;"   \
>> +"cp.b ${loadaddr} ${uboot_addr} ${filesize};"   \
>> +"setenv filesize;saveenv\0"
> 
> We usually split this into "load" and "update" steps, so you don;t
> automatically erase your flash even when the download failed.

I will change it.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-19 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1295012124-15551-7-git-send-email-sba...@denx.de> you wrote:
> The patch adds suupport for the Freescale's mx35pdk board
> (known as well as mx35_3stack).
> 
> The board boots from the NOR flash. Following devices
> are supported:
>  - two ethernet devices (FEC and SMC911x on debug board)
>  - I2C
>  - PMIC (MC13892) via I2C interface
>  - UART
>  - NOR flash (64MB)
>  - NAND flash (2GB)
>  - basic access to mc9sdz60 registers via I2C interface
> 
> Signed-off-by: Stefano Babic 
...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d7cd09c..3abb4cb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -554,6 +554,7 @@ Stefano Babic 
>   ea20davinci
>   polaris xscale
>   trizepsiv   xscale
> + mx35pdk i.MX35
>   mx51evk i.MX51
>   vision2 i.MX51

Please sort list.

> diff --git a/MAKEALL b/MAKEALL
> index a732e6a..31dbfe1 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -409,6 +409,7 @@ LIST_ARM11="  \
>   mx31ads \
>   mx31pdk \
>   mx31pdk_nand\
> + mx35pdk \
>   qong\
>   smdk6400\
>   tnetv107x_evm   \

NAK.  We don't add boards to MAKEALL any more. They get auto-selcted
from their entry in boards.cfg.

> -#define ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, table_index) \
> - (unsigned long *)((unsigned long)(ttb_base) + ((table_index) << 2))
> -
> -#define ARM_FIRST_LEVEL_PAGE_TABLE_SIZE 0x4000
> -
> -#define ARM_MMU_SECTION(ttb_base, actual_base, virtual_base, \
> - cacheable, bufferable, perm)\
> - {   \
> - register union ARM_MMU_FIRST_LEVEL_DESCRIPTOR desc; \
> - desc.word = 0;  \
> - desc.section.id = ARM_MMU_FIRST_LEVEL_SECTION_ID;   \
> - desc.section.domain = 0;\
> - desc.section.c = (cacheable);   \
> - desc.section.b = (bufferable);  \
> - desc.section.ap = (perm);   \
> - desc.section.base_address = (actual_base);  \
> - *ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, (virtual_base)) \
> - = desc.word;\
> - }
> -
> -#define X_ARM_MMU_SECTION(abase, vbase, size, cache, buff, access)   \
> - {   \
> - int i; int j = abase; int k = vbase;\
> - for (i = size; i > 0 ; i--, j++, k++)   \
> - ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access); \
> - }

Here and everywhere else: Macros with multiple statements should be
enclosed in a do - while block.

> diff --git a/board/freescale/mx35pdk/config.mk 
> b/board/freescale/mx35pdk/config.mk
> new file mode 100644
> index 000..3db1c85
> --- /dev/null
> +++ b/board/freescale/mx35pdk/config.mk
...
> +CONFIG_SYS_TEXT_BASE = 0xA000

NAK.  Please move CONFIG_SYS_TEXT_BASE into board config file and
ditch config.mk

> +/* To support 133MHz DDR */
> +.macro  init_drive_strength
> +/*
> + mov r0, #0x2
> + ldr r1, =IOMUXC_BASE_ADDR
> + add r1, r1, #0x368
> +add r2, r1, #0x4C8 - 0x368
> +1:  str r0, [r1], #4
> + cmp r1, r2
> +ble 1b
> +*/
> +.endm /* init_drive_strength */

Please remove dead code - please fix globally.

Please use TAB for indentation - please fix globally.

> +int checkboard(void)
> +{
> + u32 system_rev = get_cpu_rev();
> + u32 board_rev = 0;
> + struct ccm_regs *ccm =
> + (struct ccm_regs *)IMX_CCM_BASE;
> +
> + puts("Board: MX35 3STACK ");

Is this the correct board name?

> + board_rev = board_detect();
> +
> + /* Print board revision */
> + if (board_rev)
> + puts("2.0");
> + else
> + puts("1.0");

Maybe board_detect() could return the board revision sirectly, so you
can use a single printf for all this, like:

printf("Board: mx35pdk %d.0", board_detect());

?

> + /* Print CPU revision */
> + puts(" i.MX35 ");
> + if (system_rev & CHIP_REV_2_0)
> + puts("2.0 [");
> + else
> + puts("1.0 [");

Eventually something similar could / should be done here?


> --- /dev/null
> +++ b/doc/README.mx35pdk
...
...
> +NAND partitions can be recognized enabling in kernel 
> CONFIG_MTD_REDBOOT_PARTS.
> +For this board, CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK should be set to 2.
> +
> +However, the setup in redboot is not correct and does not use the whole 
> flash. 
> +
> +Better solution is to use the kernel parameter mtdparts. Here the resulting 
> script to be defin

Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-18 Thread Stefano Babic
On 01/18/2011 10:40 AM, Wolfgang Denk wrote:
> No, you are wrong.  CONFIG_SYS_TEXT_BASE is always set in the
> configuration file, only a few files still have it in config.mk -
> these files need to be cleand up, and ideally config.mk should be
> ditched.

I see, understood. I will drop config.mk.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-18 Thread Wolfgang Denk
Dear Stefano Babic,

In message <4d34744b.2030...@denx.de> you wrote:
>
> I have not understood this point. The link address CONFIG_SYS_TEXT_BASE
> is always set in the config.mk file, because it is needed by the linker
> process, and it is not set in the configuration file (I think you mean
> mx35pdk.h). All boards follow this rule. If I move it, the linker does
> not find it. Do you mean probably something else ?

No, you are wrong.  CONFIG_SYS_TEXT_BASE is always set in the
configuration file, only a few files still have it in config.mk -
these files need to be cleand up, and ideally config.mk should be
ditched.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Beware of the Turing Tar-pit in  which  everything  is  possible  but
nothing of interest is easy.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-17 Thread Stefano Babic
On 01/17/2011 05:54 PM, Stefano Babic wrote:

>>
>> Need move this config to board config file and remove this file.
> 
>
> I have not understood this point. The link address
> CONFIG_SYS_TEXT_BASE
> is always set in the config.mk file, because it is needed by the linker
> process, and it is not set in the configuration file (I think you mean
> mx35pdk.h). All boards follow this rule. If I move it, the linker does
> not find it. Do you mean probably something else ?
>

Sorry, I checked again, I missed the new rule for TEXT_BASE - you are
right, I will move it in boards.cfg (my preferred way).

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-17 Thread Stefano Babic
On 01/17/2011 05:43 PM, Jason Liu wrote:
> Hi, Stefano,

Hi Jason,

> 
> You want to remove this file, is there this file in the mainline?

Of course, it was a mistake. I drop it.

>> diff --git a/board/freescale/mx35pdk/config.mk 
>> b/board/freescale/mx35pdk/config.mk
>> new file mode 100644
>> index 000..3db1c85
>> --- /dev/null
>> +++ b/board/freescale/mx35pdk/config.mk
>> @@ -0,0 +1,25 @@
>> +#
>> +# (C) Copyright 2010
>> +# Stefano Babic DENX Software Engineering sba...@denx.de.
>> +#
>> +# Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
>> +#
>> +# See file CREDITS for list of people who contributed to this
>> +# project.
>> +#
>> +# 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
>> +#
>> +CONFIG_SYS_TEXT_BASE = 0xA000
> 
> Need move this config to board config file and remove this file.

I have not understood this point. The link address CONFIG_SYS_TEXT_BASE
is always set in the config.mk file, because it is needed by the linker
process, and it is not set in the configuration file (I think you mean
mx35pdk.h). All boards follow this rule. If I move it, the linker does
not find it. Do you mean probably something else ?

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-17 Thread Jason Liu
Hi, Stefano,

2011/1/14 Stefano Babic :
> The patch adds suupport for the Freescale's mx35pdk board
> (known as well as mx35_3stack).
>
> The board boots from the NOR flash. Following devices
> are supported:
>  - two ethernet devices (FEC and SMC911x on debug board)
>  - I2C
>  - PMIC (MC13892) via I2C interface
>  - UART
>  - NOR flash (64MB)
>  - NAND flash (2GB)
>  - basic access to mc9sdz60 registers via I2C interface
>
> Signed-off-by: Stefano Babic 
> ---
>  MAINTAINERS                             |    1 +
>  MAKEALL                                 |    1 +
>  arch/arm/include/asm/arch-mx35/mmu.h    |  172 --

You want to remove this file, is there this file in the mainline?

>  board/freescale/mx35pdk/Makefile        |   49 
>  board/freescale/mx35pdk/config.mk       |   25 ++
>  board/freescale/mx35pdk/imximage.cfg    |   62 +
>  board/freescale/mx35pdk/lowlevel_init.S |  382 
> +++
>  board/freescale/mx35pdk/mx35pdk.c       |  313 +
>  board/freescale/mx35pdk/mx35pdk.h       |  101 
>  boards.cfg                              |    1 +
>  doc/README.mx35pdk                      |  185 +++
>  include/configs/mx35pdk.h               |  269 ++
>  12 files changed, 1389 insertions(+), 172 deletions(-)
>  delete mode 100644 arch/arm/include/asm/arch-mx35/mmu.h
>  create mode 100644 board/freescale/mx35pdk/Makefile
>  create mode 100644 board/freescale/mx35pdk/config.mk
>  create mode 100644 board/freescale/mx35pdk/imximage.cfg
>  create mode 100644 board/freescale/mx35pdk/lowlevel_init.S
>  create mode 100644 board/freescale/mx35pdk/mx35pdk.c
>  create mode 100644 board/freescale/mx35pdk/mx35pdk.h
>  create mode 100644 doc/README.mx35pdk
>  create mode 100644 include/configs/mx35pdk.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d7cd09c..3abb4cb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -554,6 +554,7 @@ Stefano Babic 
>        ea20            davinci
>        polaris         xscale
>        trizepsiv       xscale
> +       mx35pdk         i.MX35
>        mx51evk         i.MX51
>        vision2         i.MX51
>
> diff --git a/MAKEALL b/MAKEALL
> index a732e6a..31dbfe1 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -409,6 +409,7 @@ LIST_ARM11="                        \
>        mx31ads                 \
>        mx31pdk                 \
>        mx31pdk_nand            \
> +       mx35pdk                 \
>        qong                    \
>        smdk6400                \
>        tnetv107x_evm           \
> diff --git a/arch/arm/include/asm/arch-mx35/mmu.h 
> b/arch/arm/include/asm/arch-mx35/mmu.h
> deleted file mode 100644
> index 1b15dba..000
> --- a/arch/arm/include/asm/arch-mx35/mmu.h
> +++ /dev/null
> @@ -1,172 +0,0 @@
> -/*
> - * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
> - */
> -

Ditto,

[snip]

> diff --git a/board/freescale/mx35pdk/config.mk 
> b/board/freescale/mx35pdk/config.mk
> new file mode 100644
> index 000..3db1c85
> --- /dev/null
> +++ b/board/freescale/mx35pdk/config.mk
> @@ -0,0 +1,25 @@
> +#
> +# (C) Copyright 2010
> +# Stefano Babic DENX Software Engineering sba...@denx.de.
> +#
> +# Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# 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
> +#
> +CONFIG_SYS_TEXT_BASE = 0xA000

Need move this config to board config file and remove this file.

[snip]

>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board.

2011-01-14 Thread Stefano Babic
The patch adds suupport for the Freescale's mx35pdk board
(known as well as mx35_3stack).

The board boots from the NOR flash. Following devices
are supported:
 - two ethernet devices (FEC and SMC911x on debug board)
 - I2C
 - PMIC (MC13892) via I2C interface
 - UART
 - NOR flash (64MB)
 - NAND flash (2GB)
 - basic access to mc9sdz60 registers via I2C interface

Signed-off-by: Stefano Babic 
---
 MAINTAINERS |1 +
 MAKEALL |1 +
 arch/arm/include/asm/arch-mx35/mmu.h|  172 --
 board/freescale/mx35pdk/Makefile|   49 
 board/freescale/mx35pdk/config.mk   |   25 ++
 board/freescale/mx35pdk/imximage.cfg|   62 +
 board/freescale/mx35pdk/lowlevel_init.S |  382 +++
 board/freescale/mx35pdk/mx35pdk.c   |  313 +
 board/freescale/mx35pdk/mx35pdk.h   |  101 
 boards.cfg  |1 +
 doc/README.mx35pdk  |  185 +++
 include/configs/mx35pdk.h   |  269 ++
 12 files changed, 1389 insertions(+), 172 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-mx35/mmu.h
 create mode 100644 board/freescale/mx35pdk/Makefile
 create mode 100644 board/freescale/mx35pdk/config.mk
 create mode 100644 board/freescale/mx35pdk/imximage.cfg
 create mode 100644 board/freescale/mx35pdk/lowlevel_init.S
 create mode 100644 board/freescale/mx35pdk/mx35pdk.c
 create mode 100644 board/freescale/mx35pdk/mx35pdk.h
 create mode 100644 doc/README.mx35pdk
 create mode 100644 include/configs/mx35pdk.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d7cd09c..3abb4cb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -554,6 +554,7 @@ Stefano Babic 
ea20davinci
polaris xscale
trizepsiv   xscale
+   mx35pdk i.MX35
mx51evk i.MX51
vision2 i.MX51
 
diff --git a/MAKEALL b/MAKEALL
index a732e6a..31dbfe1 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -409,6 +409,7 @@ LIST_ARM11="\
mx31ads \
mx31pdk \
mx31pdk_nand\
+   mx35pdk \
qong\
smdk6400\
tnetv107x_evm   \
diff --git a/arch/arm/include/asm/arch-mx35/mmu.h 
b/arch/arm/include/asm/arch-mx35/mmu.h
deleted file mode 100644
index 1b15dba..000
--- a/arch/arm/include/asm/arch-mx35/mmu.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#ifndef __ARM_ARCH_MMU_H
-#define __ARM_ARCH_MMU_H
-
-/*
- * Translation Table Base Bit Masks
- */
-#define ARM_TRANSLATION_TABLE_MASK   0xC000
-
-/*
- * Domain Access Control Bit Masks
- */
-#define ARM_ACCESS_TYPE_NO_ACCESS(domain_num)(0x0 << (domain_num)*2)
-#define ARM_ACCESS_TYPE_CLIENT(domain_num)   (0x1 << (domain_num)*2)
-#define ARM_ACCESS_TYPE_MANAGER(domain_num)  (0x3 << (domain_num)*2)
-
-struct ARM_MMU_FIRST_LEVEL_FAULT {
-   unsigned int id:2;
-   unsigned int sbz:30;
-};
-
-#define ARM_MMU_FIRST_LEVEL_FAULT_ID 0x0
-
-struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE {
-   unsigned int id:2;
-   unsigned int imp:2;
-   unsigned int domain:4;
-   unsigned int sbz:1;
-   unsigned int base_address:23;
-};
-
-#define ARM_MMU_FIRST_LEVEL_PAGE_TABLE_ID 0x1
-
-struct ARM_MMU_FIRST_LEVEL_SECTION {
-   unsigned int id:2;
-   unsigned int b:1;
-   unsigned int c:1;
-   unsigned int imp:1;
-   unsigned int domain:4;
-   unsigned int sbz0:1;
-   unsigned int ap:2;
-   unsigned int sbz1:8;
-   unsigned int base_address:12;
-};
-
-#define ARM_MMU_FIRST_LEVEL_SECTION_ID 0x2
-
-struct ARM_MMU_FIRST_LEVEL_RESERVED {
-   unsigned int id:2;
-   unsigned int sbz:30;
-};
-
-#define ARM_MMU_FIRST_LEVEL_RESERVED_ID 0x3
-
-#define ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, table_index) \
-   (unsigned long *)((unsigned long)(ttb_base) + ((table_index) << 2))
-
-#define ARM_FIRST_LEVEL_PAGE_TABLE_SIZE 0x4000
-
-#define ARM_MMU_SECTION(ttb_base, actual_base, virtual_base,   \
-   cacheable, bufferable, perm)\
-   {   \
-   register union ARM_MMU_FIRST_LEVEL_DESCRIPTOR desc; \
-   desc.word = 0;  \
-   desc.section.id = ARM_MMU_FIRST_LEVEL_SECTION_ID;   \
-   desc.section.domain = 0;