pcaam1: Add support for the Phytec phyCARD-A-M1 (PCA-A-M1)
Subsystems (4)
PATCH 2/2 pcaam1: Change the machine id/name to follow the phyCARD naming convention
In reply to Christian HempChange the machine id/name to follow the phyCARD naming convention. This patch can be dropped if the phyCARD-A-M1 is updated in the official machine registry.
--- arch/arm/tools/mach-types | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/tools/mach-types +1 -1
@@ -2573,7 +2573,7 @@ nautel_am35xx MACH_NAUTEL_LPC3240 NAUTEL_LPC3240 2591 glacier MACH_GLACIER GLACIER 2592 phrazer_bulldog MACH_PHRAZER_BULLDOG PHRAZER_BULLDOG 2593 omap3_bulldog MACH_OMAP3_BULLDOG OMAP3_BULLDOG 2594 -pca101 MACH_PCA101 PCA101 2595 +pcaam1 MACH_PCAAM1 PCAAM1 2595 buzzc MACH_BUZZC BUZZC 2596 sasie2 MACH_SASIE2 SASIE2 2597 smartmeter_dl MACH_SMARTMETER_DL SMARTMETER_DL 2599
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/2 pcaam1: Add support for the Phytec phyCARD-A-M1 (PCA-A-M1)
Add support for the phyCARD-A-M1 (PCA-A-M1).
--- arch/arm/Makefile | 1 + arch/arm/boards/phycard-a-m1/Makefile | 24 ++ arch/arm/boards/phycard-a-m1/config.h | 25 ++ arch/arm/boards/phycard-a-m1/env/config | 57 ++++ arch/arm/boards/phycard-a-m1/lowlevel.c | 240 +++++++++++++++++ arch/arm/boards/phycard-a-m1/pca-a-m1.c | 397 +++++++++++++++++++++++++++++ arch/arm/boards/phycard-a-m1/pca-a-m1.dox | 5 + arch/arm/configs/phycard_a_m1_defconfig | 61 +++++ arch/arm/mach-imx/Kconfig | 13 + 9 files changed, 823 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boards/phycard-a-m1/Makefile create mode 100644 arch/arm/boards/phycard-a-m1/config.h create mode 100644 arch/arm/boards/phycard-a-m1/env/config create mode 100644 arch/arm/boards/phycard-a-m1/lowlevel.c create mode 100644 arch/arm/boards/phycard-a-m1/pca-a-m1.c create mode 100644 arch/arm/boards/phycard-a-m1/pca-a-m1.dox create mode 100644 arch/arm/configs/phycard_a_m1_defconfig
arch/arm/Makefile +1 -0
@@ -95,6 +95,7 @@ board-$(CONFIG_MACH_PANDA) := panda board-$(CONFIG_MACH_PCM049) := pcm049 board-$(CONFIG_MACH_PCA100) := phycard-i.MX27 board-$(CONFIG_MACH_PCAAL1) := phycard-a-l1 +board-$(CONFIG_MACH_PCAAM1) := phycard-a-m1 board-$(CONFIG_MACH_PCM037) := pcm037 board-$(CONFIG_MACH_PCM038) := pcm038 board-$(CONFIG_MACH_PCM043) := pcm043
arch/arm/boards/phycard-a-m1/Makefile new file +24 -0
@@ -0,0 +1,24 @@ +# +# (C) Copyright 2012 Christian Hemp <[email protected]> +# +# 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 +# + +obj-y += lowlevel.o +obj-y += pca-a-m1.o
arch/arm/boards/phycard-a-m1/config.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* (C) Copyright 2007 Juergen Beisert <[email protected]> +* +* 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 +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_MX35_HCLK_FREQ 24000000 + +#endif
arch/arm/boards/phycard-a-m1/env/config new file +57 -0
57 lines not on this page · raw message
arch/arm/boards/phycard-a-m1/lowlevel.c new file +240 -0
240 lines not on this page · raw message
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +397 -0
397 lines not on this page · raw message
arch/arm/boards/phycard-a-m1/pca-a-m1.dox new file +5 -0
@@ -0,0 +1,5 @@ +/** @page pca-a-m1 Phytec's phyCARD-A-M1 + +This CPU card is based on a Freescale i.MX35 CPU. + +*/
arch/arm/configs/phycard_a_m1_defconfig new file +61 -0
61 lines not on this page · raw message
arch/arm/mach-imx/Kconfig +13 -0
@@ -13,6 +13,7 @@ config ARCH_TEXT_BASE default 0x87f00000 if MACH_FREESCALE_MX25_3STACK && FREESCALE_MX25_3STACK_SDRAM_128MB_MDDR default 0x87f00000 if MACH_FREESCALE_MX35_3STACK default 0xa7f00000 if MACH_PCA100 + default 0x87d00000 if MACH_PCAAM1 default 0xa0000000 if MACH_PCM038 default 0x87f00000 if MACH_PCM037 default 0x87f00000 if MACH_PCM043
@@ -35,6 +36,7 @@ config BOARDINFO default "Freescale MX35 3Stack" if MACH_FREESCALE_MX35_3STACK default "Freescale MX25 3Stack" if MACH_FREESCALE_MX25_3STACK default "Phytec phyCard-i.MX27" if MACH_PCA100 + default "Phytec phyCARD-A-M1" if MACH_PCAAM1 default "Phytec phyCORE-i.MX27" if MACH_PCM038 default "Phytec phyCORE-i.MX31" if MACH_PCM037 default "Phytec phyCORE-i.MX35" if MACH_PCM043
@@ -352,6 +354,14 @@ config MACH_PCM043 Say Y here if you are using Phytec's phyCORE-i.MX35 (pcm043) equipped with a Freescale i.MX35 Processor +config MACH_PCAAM1 + bool "phyCARD-A-M1" + select MACH_HAS_LOWLEVEL_INIT + select ARCH_HAS_L2X0 + help + Say Y here if you are using Phytec's phyCARD-A-M1 (pca-a-m1) equipped + with a Freescale i.MX35 Processor + config MACH_GUF_CUPID bool "Garz+Fricke Cupid" select MACH_HAS_LOWLEVEL_INIT
@@ -473,6 +483,9 @@ config FREESCALE_MX25_3STACK_SDRAM_128MB_MDDR bool "128 MB (mDDR)" endchoice endif +config PCAAM1_RAM_2BANKS + depends on MACH_PCAAM1 + bool "two sdram banks equipped on phyCARD" endmenu menu "i.MX specific settings "
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 2/2] pcaam1: Change the machine id/name to follow the phyCARD naming convention
In reply to Christian HempQuoted 7 lines · Christian Hemp
Change the machine id/name to follow the phyCARD naming convention. This patch can be dropped if the phyCARD-A-M1 is updated in the official machine registry.
Signed-off-by Christian Hemp <[email protected]>--- arch/arm/tools/mach-types | 2 +-
No hand editing in this file please. Your changes will be overwritten next time we update this file from the database. In case the database already is updated just provide a patch to update to the latest version (There is a download link on the web page)
Sascha
Quoted 19 lines
1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/tools/mach-types +1
-1@@ -2573,7 +2573,7 @@ nautel_am35xx MACH_NAUTEL_LPC3240 NAUTEL_LPC3240 2591 glacier MACH_GLACIER GLACIER 2592 phrazer_bulldog MACH_PHRAZER_BULLDOG PHRAZER_BULLDOG 2593 omap3_bulldog MACH_OMAP3_BULLDOG OMAP3_BULLDOG 2594 -pca101 MACH_PCA101 PCA101 2595 +pcaam1 MACH_PCAAM1 PCAAM1 2595 buzzc MACH_BUZZC BUZZC 2596 sasie2 MACH_SASIE2 SASIE2 2597 smartmeter_dl MACH_SMARTMETER_DL SMARTMETER_DL 2599Signature · 1 line
1.7.0.4
Signature · 9 lines
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-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerHi Christian,
Quoted 55 lines · Christian Hemp
Add support for the phyCARD-A-M1 (PCA-A-M1).
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +53
-0+ +static struct fb_videomode pcaam1_fb_mode[] = { + { + .name ="Primeview-PD050VL1" , + .refresh =60 , + .xres =640 , + .yres =480 , + .pixclock =39900 ,/* in ps (25 MHz) */ + .hsync_len =32 , + .left_margin =112 , + .right_margin =36 , + .vsync_len =2 , + .upper_margin =33 , + .lower_margin =33 , + .sync =FB_SYNC_OE_ACT_HIGH , + .vmode =FB_VMODE_NONINTERLACED , + .flag =0 , + }, { + .name ="Primeview-PD035VL1" , + .refresh =60 , + .xres =640 , + .yres =480 , + .pixclock =40000 ,/* in ps (25 MHz) */ + .hsync_len =32 , + .left_margin =112 , + .right_margin =36 , + .vsync_len =2 , + .upper_margin =33 , + .lower_margin =33 , + .sync =FB_SYNC_OE_ACT_HIGH , + .vmode =FB_VMODE_NONINTERLACED , + .flag =0 , + }, { + .name ="Primeview-PD104SLF" , + .refresh =60 , + .xres =800 , + .yres =600 , + .pixclock =25000 ,/* in ps (40,0 MHz) */ + .hsync_len =128 , + .left_margin =42 , + .right_margin =42 , + .vsync_len =4 , + .upper_margin =23 , + .lower_margin =1 , + .sync =FB_SYNC_OE_ACT_HIGH , + .vmode =FB_VMODE_NONINTERLACED , + .flag =0 , + }, { + .name ="Primeview-PM070WL4" , + .refresh =60 , + .xres =800 , + .yres =480 , + .pixclock =50505 ,/* in ps (19,8 MHz) */
arch/arm/boards/phycard-a-m1/pca-a-m1.c line 122
Quoted 10 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +10
-0+ .hsync_len = 128, + .left_margin = 42, + .right_margin = 42, + .vsync_len = 2, + .upper_margin = 33, + .lower_margin = 33, + .sync = FB_SYNC_OE_ACT_HIGH, + .vmode = FB_VMODE_NONINTERLACED, + .flag = 0, + }
This duplicates the entries in ./arch/arm/boards/phycard-i.MX27/pca100.c, though with quite different timings. It would be nice if we could merge them as these seem to be your standard displays (which will also be used on i.MX6, right?)
(We would have to replace the embedded struct fb_videomode in struct imx_fb_videomode with a pointer to struct fb_videomode to do this)
I won't insist on this change now, but I might have a different opinion when the i.MX6 patches arrive..
Quoted 10 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +10
-0+ + reg =readl (IMX_CCM_BASE +CCM_RCSR ); +/* some fuses provide us vital information about connected hardware */ +if (reg &0x20000000 ) + nand_info.width =2 ;/* 16 bit */ +else + nand_info.width =1 ;/* 8 bit */ + +imx35_add_fec (&fec_info); +imx35_add_nand (&nand_info);
arch/arm/boards/phycard-a-m1/pca-a-m1.c line 251
Quoted 10 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +10
-0+ +/* reset mode: external boot */ +if ((reg &0xc00 ) ==0x800 && ((reg >>25 ) &0x3 ) ==0x01 ) { +devfs_add_partition ("nand0" ,0x00000 ,0x40000 ,PARTITION_FIXED , +"self_raw" ); +dev_add_bb_dev ("self_raw" ,"self0" ); +devfs_add_partition ("nand0" ,0x40000 ,0x20000 ,PARTITION_FIXED , +"env_raw" ); +dev_add_bb_dev ("env_raw" ,"env0" ); + }
You end up without a writable environment when you boot for example from SD card. Is this intended?
Quoted 15 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +15
-0+ +imx35_add_fb (&ipu_fb_data); +imx35_add_i2c2 (&pcaam1_i2c_3_data); +imx35_add_mmc0 (NULL ); + +armlinux_set_bootparams ((void *)0x80000100 ); +armlinux_set_architecture (MACH_TYPE_PCAAM1 ); + +return 0 ; +} + +device_initcall (pcaam1_devices_init); + +static int pcaam1_console_init (void ) +{
arch/arm/boards/phycard-a-m1/pca-a-m1.c line 276
Quoted 10 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +10
-0+imx35_add_uart0 (); + +return 0 ; +} + +console_initcall (pcaam1_console_init); + +#define M3IFCTL_IPU1 0x00000040 + +static int pcaam1_core_setup (void )
Please move this function to arch/arm/mach-imx/imx35.c and rename it to imx35_init_lowlevel. It is duplicated quite often now and always the same copy-and-paste.
Quoted 87 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +87
-0+ +/* +* AIPS setup - Only setup MPROTx registers. +* The PACR default values are good. +*/ +/* +* Set all MPROTx to be non-bufferable, trusted for R/W, +* not forced to user-mode. +*/ +writel (0x77777777 ,IMX_AIPS1_BASE ); +writel (0x77777777 ,IMX_AIPS1_BASE +0x4 ); +writel (0x77777777 ,IMX_AIPS2_BASE ); +writel (0x77777777 ,IMX_AIPS2_BASE +0x4 ); + +/* +* Clear the on and off peripheral modules Supervisor Protect bit +* for SDMA to access them. Did not change the AIPS control registers +* (offset 0x20) access type +*/ +writel (0x0 ,IMX_AIPS1_BASE +0x40 ); +writel (0x0 ,IMX_AIPS1_BASE +0x44 ); +writel (0x0 ,IMX_AIPS1_BASE +0x48 ); +writel (0x0 ,IMX_AIPS1_BASE +0x4C ); + tmp =readl (IMX_AIPS1_BASE +0x50 ); + tmp &=0x00FFFFFF ; +writel (tmp,IMX_AIPS1_BASE +0x50 ); + +writel (0x0 ,IMX_AIPS2_BASE +0x40 ); +writel (0x0 ,IMX_AIPS2_BASE +0x44 ); +writel (0x0 ,IMX_AIPS2_BASE +0x48 ); +writel (0x0 ,IMX_AIPS2_BASE +0x4C ); + tmp =readl (IMX_AIPS2_BASE +0x50 ); + tmp &=0x00FFFFFF ; +writel (tmp,IMX_AIPS2_BASE +0x50 ); + +/* MAX (Multi-Layer AHB Crossbar Switch) setup */ + +/* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */ +#define MAX_PARAM1 0x00302154 +writel (MAX_PARAM1 ,IMX_MAX_BASE +0x0 );/* for S0 */ +writel (MAX_PARAM1 ,IMX_MAX_BASE +0x100 );/* for S1 */ +writel (MAX_PARAM1 ,IMX_MAX_BASE +0x200 );/* for S2 */ +writel (MAX_PARAM1 ,IMX_MAX_BASE +0x300 );/* for S3 */ +writel (MAX_PARAM1 ,IMX_MAX_BASE +0x400 );/* for S4 */ + +/* SGPCR - always park on last master */ +writel (0x10 ,IMX_MAX_BASE +0x10 );/* for S0 */ +writel (0x10 ,IMX_MAX_BASE +0x110 );/* for S1 */ +writel (0x10 ,IMX_MAX_BASE +0x210 );/* for S2 */ +writel (0x10 ,IMX_MAX_BASE +0x310 );/* for S3 */ +writel (0x10 ,IMX_MAX_BASE +0x410 );/* for S4 */ + +/* MGPCR - restore default values */ +writel (0x0 ,IMX_MAX_BASE +0x800 );/* for M0 */ +writel (0x0 ,IMX_MAX_BASE +0x900 );/* for M1 */ +writel (0x0 ,IMX_MAX_BASE +0xa00 );/* for M2 */ +writel (0x0 ,IMX_MAX_BASE +0xb00 );/* for M3 */ +writel (0x0 ,IMX_MAX_BASE +0xc00 );/* for M4 */ +writel (0x0 ,IMX_MAX_BASE +0xd00 );/* for M5 */ + +writel (M3IFCTL_IPU1 ,IMX_M3IF_BASE ); + +return 0 ; +} + +core_initcall (pcaam1_core_setup); + +#define CCM_PDR0_PARAM_399 0x00011000 +#define CCM_PDR0_PARAM_532 0x00001000 + +static int do_cpufreq (struct command *cmdtp,int argc,char *argv[]) +{ +unsigned long freq; + +if (argc !=2 ) { +barebox_cmd_usage (cmdtp); +return 1 ; + } + + freq =simple_strtoul (argv[1 ],NULL ,0 ); + +switch (freq) { +case 399 : +writel (CCM_PDR0_PARAM_399 ,IMX_CCM_BASE +CCM_PDR0 ); +break ; +case 532 : +writel (CCM_PDR0_PARAM_532 ,IMX_CCM_BASE +CCM_PDR0 );
arch/arm/boards/phycard-a-m1/pca-a-m1.c line 375
Quoted 10 lines
arch/arm/boards/phycard-a-m1/pca-a-m1.c new file +10
-0+break ; +default : +barebox_cmd_usage (cmdtp); +return 1 ; + } + +printf ("Switched CPU frequency to %ldMHz\n" , freq); + +return 0 ; +}
We have this three times now. Please move this to some common place.
Sascha
Signature · 9 lines
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-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox