Re: [PATCH 061/149] board: freescale: Remove and add needed includes
> 在 2024年5月1日,10:44,Tom Rini 写道: > > Remove from this board vendor directory and when needed > add missing include files directly. > > Signed-off-by: Tom Rini > --- > Cc: Stefano Babic > Cc: Fabio Estevam > Cc: "NXP i.MX U-Boot Team" > Cc: Peng Fan > Cc: Giulio Benetti > Cc: Jesse Taube > Cc: Pramod Kumar > Cc: Alison Wang > Cc: Tang Yuantian > Cc: Mingkai Hu > Cc: Ashish Kumar > Cc: Priyanka Jain > Cc: Wasim Khan > Cc: Meenakshi Aggarwal > Cc: Angelo Dureghello > Cc: TsiChung Liew > Cc: Sinan Akman > Cc: Otavio Salvador > Cc: Jason Liu > Cc: Eric Nelson > Cc: Adrian Alonso > Cc: Qiang Zhao > Cc: Shengzhou Liu Acked-by: Jason Liu > --- > arch/arm/include/asm/arch-imx8m/ddr.h | 2 +- > arch/arm/include/asm/mach-imx/gpio.h | 2 ++ > board/freescale/common/cadmus.c | 3 ++- > board/freescale/common/cds_pci_ft.c | 1 - > board/freescale/common/cds_via.c | 1 - > board/freescale/common/cmd_esbc_validate.c| 2 +- > board/freescale/common/emc2305.c | 1 - > board/freescale/common/fman.c | 1 - > board/freescale/common/fsl_chain_of_trust.c | 2 +- > board/freescale/common/fsl_validate.c | 2 +- > board/freescale/common/i2c_common.c | 2 +- > board/freescale/common/i2c_mux.c | 3 ++- > board/freescale/common/ics307_clk.c | 2 +- > board/freescale/common/ls102xa_stream_id.c| 2 +- > board/freescale/common/mc34vr500.c| 1 - > board/freescale/common/mmc.c | 2 +- > board/freescale/common/ngpixis.c | 1 - > board/freescale/common/ns_access.c| 2 +- > board/freescale/common/p_corenet/law.c| 2 +- > board/freescale/common/p_corenet/tlb.c| 3 ++- > board/freescale/common/pfuze.c| 1 - > board/freescale/common/qixis.c| 2 +- > board/freescale/common/sdhc_boot.c| 1 - > board/freescale/common/sys_eeprom.c | 1 - > board/freescale/common/vid.c | 3 ++- > board/freescale/imx8mm_evk/imx8mm_evk.c | 1 - > board/freescale/imx8mm_evk/spl.c | 1 - > board/freescale/imx8mn_evk/imx8mn_evk.c | 1 - > board/freescale/imx8mn_evk/spl.c | 1 - > board/freescale/imx8mp_evk/spl.c | 1 - > board/freescale/imx8mq_evk/imx8mq_evk.c | 1 - > board/freescale/imx8mq_evk/lpddr4_timing.c| 1 - > board/freescale/imx8mq_evk/lpddr4_timing_b0.c | 1 - > board/freescale/imx8mq_evk/spl.c | 2 +- > board/freescale/imx8qm_mek/imx8qm_mek.c | 1 - > board/freescale/imx8qm_mek/spl.c | 1 - > board/freescale/imx8qxp_mek/imx8qxp_mek.c | 1 - > board/freescale/imx8qxp_mek/spl.c | 1 - > board/freescale/imx8ulp_evk/imx8ulp_evk.c | 1 - > board/freescale/imx8ulp_evk/spl.c | 1 - > board/freescale/imx93_evk/imx93_evk.c | 1 - > board/freescale/imx93_evk/spl.c | 1 - > board/freescale/imxrt1020-evk/imxrt1020-evk.c | 1 - > board/freescale/imxrt1050-evk/imxrt1050-evk.c | 1 - > board/freescale/imxrt1170-evk/imxrt1170-evk.c | 1 - > board/freescale/ls1012afrdm/eth.c | 1 - > board/freescale/ls1012afrdm/ls1012afrdm.c | 2 +- > board/freescale/ls1012aqds/eth.c | 2 +- > board/freescale/ls1012aqds/ls1012aqds.c | 2 +- > board/freescale/ls1012ardb/eth.c | 2 +- > board/freescale/ls1012ardb/ls1012ardb.c | 2 +- > board/freescale/ls1021aiot/ls1021aiot.c | 2 +- > board/freescale/ls1021aqds/ddr.c | 2 +- > board/freescale/ls1028a/ddr.c | 1 - > board/freescale/ls1028a/ls1028a.c | 2 +- > board/freescale/ls1043aqds/ddr.c | 1 - > board/freescale/ls1043aqds/eth.c | 2 +- > board/freescale/ls1043aqds/ls1043aqds.c | 2 +- > board/freescale/ls1043ardb/cpld.c | 2 +- > board/freescale/ls1043ardb/ddr.c | 1 - > board/freescale/ls1043ardb/eth.c | 2 +- > board/freescale/ls1046afrwy/ddr.c | 1 - > board/freescale/ls1046afrwy/eth.c | 2 +- > board/freescale/ls1046afrwy/ls1046afrwy.c | 2 +- > board/freescale/ls1046aqds/ddr.c | 1 - > board/freescale/ls1046aqds/eth.c | 2 +- > board/freescale/ls1046aqds/ls1046aqds.c | 2 +- > board/freescale/ls1046ardb/cpld.c | 2 +- > board/freescale
Re: [PATCH] imx53-qsb: Convert to watchdog driver model
From: Fabio Estevam Sent: Thursday, February 22, 2024 1:39 AM To: sba...@denx.de Cc: Jason Liu ; u-boot@lists.denx.de ; Fabio Estevam Subject: [PATCH] imx53-qsb: Convert to watchdog driver model Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset. Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset. Signed-off-by: Fabio Estevam --- arch/arm/dts/imx53-qsb-u-boot.dtsi | 14 ++ configs/mx53loco_defconfig | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 arch/arm/dts/imx53-qsb-u-boot.dtsi Thx for the fix. Reviewed-by: Jason Liu diff --git a/arch/arm/dts/imx53-qsb-u-boot.dtsi b/arch/arm/dts/imx53-qsb-u-boot.dtsi new file mode 100644 index ..593ab7caa635 --- /dev/null +++ b/arch/arm/dts/imx53-qsb-u-boot.dtsi @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/ { + wdt-reboot { + compatible = "wdt-reboot"; + wdt = <>; + bootph-pre-ram; + }; +}; + + { + bootph-pre-ram; +}; + diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig index d4de8df7b49d..e2d3bc0b094e 100644 --- a/configs/mx53loco_defconfig +++ b/configs/mx53loco_defconfig @@ -60,6 +60,8 @@ CONFIG_POWER_FSL=y CONFIG_POWER_I2C=y CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_WATCHDOG=y CONFIG_USB=y CONFIG_USB_EHCI_MX5=y CONFIG_USB_STORAGE=y @@ -67,3 +69,4 @@ CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_IMX_WATCHDOG=y -- 2.34.1
RE: [PATCH 00/13] x86: Various minor enhancements for coreboot
> -Original Message- > From: Simon Glass > Sent: 2023年2月21日 3:49 > To: U-Boot Mailing List > Cc: Bin Meng ; Simon Glass ; > AKASHI Takahiro ; Andrew Scull > ; Heinrich Schuchardt ; Ilias > Apalodimas ; Jason Liu ; > John Keeping ; Marek Vasut ; > Masahisa Kojima ; Michal Suchanek > ; Pali Rohár ; Pierre-Clément Tosi > ; Rasmus Villemoes ; > Stefan Roese > Subject: [PATCH 00/13] x86: Various minor enhancements for coreboot > > This series includes some patches generated while getting U-Boot to boot more > nicely on Brya, an Adler Lake Chromebook. > > This includes: > - show the ACPI tables with 'acpi list' > - get the UART to work even if coreboot doesn't enable it > - show unimplemented sysinfo tags > - fix for keyboard not working > - fix for trying to set up PCI regions when the info is not available > - fix for looking at inaccessible memory to find the sysinfo table > > > Simon Glass (13): > mtrr: Don't show an invalid CPU number > x86: Adjust search range for sysinfo table > input: Only reset the keyboard when running bare metal > x86: coreboot: Allow ACPI tables to be recorded > x86: coreboot: Collect the address of the ACPI tables > x86: Allow locating UARTs by device ID > pci: coreboot: Don't read regions when booting > usb: Quieten a debug message > x86: coreboot: Use a memory-mapped UART > x86: coreboot: Document how to enable the debug UART > x86: coreboot: Scan PCI after relocation > x86: coreboot: Log function names and line numbers > x86: coreboot: Show unimplemented sysinfo tags This patch-set looks fine to me, thus, Reviewed-by: Jason Liu > > arch/x86/cpu/cpu.c | 2 +- > arch/x86/dts/coreboot.dts | 4 ++ > arch/x86/include/asm/cb_sysinfo.h | 8 +++ > arch/x86/include/asm/coreboot_tables.h | 2 + > arch/x86/lib/coreboot/cb_sysinfo.c | 13 + > cmd/Kconfig| 3 +- > cmd/acpi.c | 4 ++ > cmd/x86/cbsysinfo.c| 9 > cmd/x86/mtrr.c | 3 +- > configs/coreboot_defconfig | 5 ++ > doc/board/coreboot/coreboot.rst| 29 +++ > drivers/input/i8042.c | 13 +++-- > drivers/pci/pci-uclass.c | 4 ++ > drivers/serial/serial_coreboot.c | 69 +++--- > drivers/usb/host/xhci.c| 4 +- > include/asm-generic/global_data.h | 4 +- > include/configs/coreboot.h | 2 + > include/pci_ids.h | 3 ++ > 18 files changed, 161 insertions(+), 20 deletions(-) > > -- > 2.39.2.637.g21b0678d19-goog smime.p7s Description: S/MIME cryptographic signature
RE: [PATCH v2 3/4] cmd: bdinfo: introduce bdinfo_print_size() helper
> -Original Message- > From: Ovidiu Panait > Sent: 2022年8月30日 1:02 > To: u-boot@lists.denx.de > Cc: Ovidiu Panait ; Simon Glass ; > Andy Shevchenko ; Dzmitry Sankouski > ; Heinrich Schuchardt ; Jason > Liu > Subject: [PATCH v2 3/4] cmd: bdinfo: introduce bdinfo_print_size() helper > > Add bdinfo_print_size() helper to display size variables (such as cache > sizes) in bdinfo format. The size is printed as "xxx Bytes", "xxx KiB", "xxx MiB", > "xxx GiB", etc as needed; > > Reviewed-by: Simon Glass > Signed-off-by: Ovidiu Panait > --- > > Changes in v2: > Added "Reviewed-by" tag from Simon. > > cmd/bdinfo.c | 7 +++ > include/init.h | 13 + > 2 files changed, 20 insertions(+) > The patch looks good to me. Reviewed-by: Jason Liu > diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 37cd8a57eb..9e23c4dd8f > 100644 > --- a/cmd/bdinfo.c > +++ b/cmd/bdinfo.c > @@ -16,9 +16,16 @@ > #include > #include > #include > +#include > > DECLARE_GLOBAL_DATA_PTR; > > +void bdinfo_print_size(const char *name, uint64_t size) { > + printf("%-12s= ", name); > + print_size(size, "\n"); > +} > + > void bdinfo_print_num_l(const char *name, ulong value) { > printf("%-12s= 0x%0*lx\n", name, 2 * (int)sizeof(value), value); diff --git > a/include/init.h b/include/init.h index 7b8f62c121..02bb4ce13e 100644 > --- a/include/init.h > +++ b/include/init.h > @@ -343,6 +343,19 @@ void bdinfo_print_num_ll(const char *name, > unsigned long long value); > /* Print a clock speed in MHz */ > void bdinfo_print_mhz(const char *name, unsigned long hz); > > +/** > + * bdinfo_print_size - print size variables in bdinfo format > + * @name:string to print before the size > + * @size:size to print > + * > + * Helper function for displaying size variables as properly formatted > +bdinfo > + * entries. The size is printed as "xxx Bytes", "xxx KiB", "xxx MiB", > + * "xxx GiB", etc. as needed; > + * > + * For use in arch_print_bdinfo(). > + */ > +void bdinfo_print_size(const char *name, uint64_t size); > + > /* Show arch-specific information for the 'bd' command */ void > arch_print_bdinfo(void); > > -- > 2.25.1 smime.p7s Description: S/MIME cryptographic signature
RE: [PATCH 07/14] video: Drop references to CONFIG_VIDEO et al
> -Original Message- > From: Simon Glass > Sent: 2022年1月23日 22:04 > To: U-Boot Mailing List > Cc: Anatolij Gustschin ; Jagan Teki > ; Andre Przywara ; > Simon Glass ; Andy Shevchenko > ; Aswath Govindraju > ; Aymen Sghaier ; Bin Meng > ; Dario Binacchi ; Fabio Estevam > ; Heiko Schocher ; Heinrich Schuchardt > ; Jaehoon Chung ; Jason > Liu ; Joel Peshkin ; > Kory Maincent ; Marek Vasut > ; Michal Simek ; dl-uboot-imx > ; Ovidiu Panait ; Peng > Fan ; Rasmus Villemoes ; > samuel.e...@siemens.com; Stefan Bosch ; Stefan > Roese ; Stefano Babic > Subject: [PATCH 07/14] video: Drop references to CONFIG_VIDEO et al > > Drop the Kconfigs which are not used and all references to them. In particular, > this drops CONFIG_VIDEO to avoid confusion and allow us to eventually > rename CONFIG_DM_VIDEO to CONFIG_VIDEO. > > Also drop the prototype for video_get_info_str() which is no-longer used. > > Signed-off-by: Simon Glass > --- > > README| 3 - > arch/arm/include/asm/mach-imx/mx5_video.h | 5 -- > .../mach-nexell/include/mach/display_dev.h| 2 +- > board/freescale/mx51evk/Makefile | 1 - > board/freescale/mx53loco/Makefile | 1 - > board/kosagi/novena/novena_spl.c | 23 > cmd/Kconfig | 2 +- > cmd/bdinfo.c | 2 +- > cmd/bmp.c | 4 +- > common/fdt_support.c | 2 +- > common/stdio.c| 3 +- > drivers/video/Kconfig | 56 +-- > drivers/video/nexell_display.c| 3 +- > include/asm-generic/global_data.h | 2 +- > include/configs/pxm2.h| 7 --- > include/configs/rut.h | 9 --- > lib/efi_loader/Kconfig| 1 - > 17 files changed, 10 insertions(+), 116 deletions(-) For the imx51/53 board. Acked-by: Jason Liu > > diff --git a/README b/README > index 816d9c4dfb2..40ef21df3b5 100644 > --- a/README > +++ b/README > @@ -1013,9 +1013,6 @@ The following options need to be configured: > support, and should also define these other macros: > > CONFIG_SYS_DIU_ADDR > - CONFIG_VIDEO > - CONFIG_VIDEO_SW_CURSOR > - CONFIG_VGA_AS_SINGLE_DEVICE > > The DIU driver will look for the 'video-mode' environment > variable, and if defined, enable the DIU as a console during diff --git > a/arch/arm/include/asm/mach-imx/mx5_video.h > b/arch/arm/include/asm/mach-imx/mx5_video.h > index dc6aa00c894..b55c0fe8971 100644 > --- a/arch/arm/include/asm/mach-imx/mx5_video.h > +++ b/arch/arm/include/asm/mach-imx/mx5_video.h > @@ -6,12 +6,7 @@ > #ifndef __MX5_VIDEO_H > #define __MX5_VIDEO_H > > -#ifdef CONFIG_VIDEO > -void lcd_enable(void); > -void setup_iomux_lcd(void); > -#else > static inline void lcd_enable(void) { } static inline void setup_iomux_lcd(void) > { } -#endif > > #endif > diff --git a/arch/arm/mach-nexell/include/mach/display_dev.h > b/arch/arm/mach-nexell/include/mach/display_dev.h > index ffa45518d99..39b28ca1299 100644 > --- a/arch/arm/mach-nexell/include/mach/display_dev.h > +++ b/arch/arm/mach-nexell/include/mach/display_dev.h > @@ -8,7 +8,7 @@ > #ifndef _NX__DISPLAY_DEV_H_ > #define _NX__DISPLAY_DEV_H_ > > -#if defined CONFIG_VIDEO || defined CONFIG_DM_VIDEO > +#if defined CONFIG_DM_VIDEO > #elif defined CONFIG_LCD > #include > #endif > diff --git a/board/freescale/mx51evk/Makefile > b/board/freescale/mx51evk/Makefile > index 1a9581cabf9..808e35015e8 100644 > --- a/board/freescale/mx51evk/Makefile > +++ b/board/freescale/mx51evk/Makefile > @@ -5,4 +5,3 @@ > # (C) Copyright 2009 Freescale Semiconductor, Inc. > > obj-y += mx51evk.o > -obj-$(CONFIG_VIDEO) += mx51evk_video.o > diff --git a/board/freescale/mx53loco/Makefile > b/board/freescale/mx53loco/Makefile > index d2ebd94dca1..9befe426957 100644 > --- a/board/freescale/mx53loco/Makefile > +++ b/board/freescale/mx53loco/Makefile > @@ -4,4 +4,3 @@ > # Jason Liu > > obj-y+= mx53loco.o > -obj-$(CONFIG_VIDEO) += mx53loco_video.o > diff --git a/board/kosagi/novena/novena_spl.c > b/board/kosagi/novena/novena_spl.c > index 3d22f2019e9..24c0fb22268 100644 > --- a/board/kosagi/novena/novena_spl.c > +++ b/board/kosagi/novena/novena_spl.c > @@ -379,30 +379,7 @@ static void novena_spl_setup_iomux_uart(void) > imx_iomux_v3_setu
RE: [RFC PATCH 04/10] FWU: Add metadata access functions for GPT partitioned block devices
> -Original Message- > From: Sughosh Ganu > Sent: 2021年11月25日 15:02 > To: u-boot@lists.denx.de > Cc: Patrick Delaunay ; Patrice Chotard > ; Heinrich Schuchardt ; > Alexander Graf ; Simon Glass ; Bin > Meng ; Peng Fan ; AKASHI > Takahiro ; Ilias Apalodimas > ; Jose Marinho ; Grant > Likely ; Jason Liu ; Sughosh > Ganu > Subject: [RFC PATCH 04/10] FWU: Add metadata access functions for GPT > partitioned block devices > > In the FWU Multi Bank Update feature, the information about the updatable > images is stored as part of the metadata, on a separate partition. Add > functions for reading from and writing to the metadata when the updatable > images and the metadata are stored on a block device which is formated with > GPT based partition scheme. > > Signed-off-by: Sughosh Ganu > --- > lib/fwu_updates/fwu_metadata_gpt_blk.c | 716 > + > 1 file changed, 716 insertions(+) > create mode 100644 lib/fwu_updates/fwu_metadata_gpt_blk.c > > diff --git a/lib/fwu_updates/fwu_metadata_gpt_blk.c > b/lib/fwu_updates/fwu_metadata_gpt_blk.c > new file mode 100644 > index 00..98cc53f706 > --- /dev/null > +++ b/lib/fwu_updates/fwu_metadata_gpt_blk.c > @@ -0,0 +1,716 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Copyright (c) 2021, Linaro Limited > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#define PRIMARY_VALID0x1 > +#define SECONDARY_VALID 0x2 > + > +#define MDATA_READ (u8)0x1 > +#define MDATA_WRITE (u8)0x2 > + > +#define IMAGE_ACCEPT_SET (u8)0x1 > +#define IMAGE_ACCEPT_CLEAR (u8)0x2 Better to define as the followings: #define MDATA_READ ((u8)0x1) #define MDATA_WRITE ((u8)0x2) #define IMAGE_ACCEPT_SET((u8)0x1) #define IMAGE_ACCEPT_CLEAR ((u8)0x2) > + > +static int gpt_verify_metadata(struct fwu_metadata *metadata, bool > +pri_part) { > + u32 calc_crc32; > + void *buf; > + > + buf = >version; > + calc_crc32 = crc32(0, buf, sizeof(*metadata) - sizeof(u32)); > + > + if (calc_crc32 != metadata->crc32) { > + log_err("crc32 check failed for %s metadata partition\n", > + pri_part ? "primary" : "secondary"); > + return -1; > + } > + > + return 0; > +} > + > +static int gpt_get_metadata_partitions(struct blk_desc *desc, > +u32 *primary_mpart, > +u32 *secondary_mpart) > +{ > + int i, ret; > + u32 nparts, mparts; > + gpt_entry *gpt_pte = NULL; > + const efi_guid_t fwu_metadata_guid = FWU_METADATA_GUID; > + > + ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, > + desc->blksz); > + > + ret = get_gpt_hdr_parts(desc, gpt_head, _pte); > + if (ret < 0) { > + log_err("Error getting GPT header and partitions\n"); > + ret = -EIO; > + goto out; > + } > + > + nparts = gpt_head->num_partition_entries; > + for (i = 0, mparts = 0; i < nparts; i++) { > + if (!guidcmp(_metadata_guid, > + _pte[i].partition_type_guid)) { > + ++mparts; > + if (!*primary_mpart) > + *primary_mpart = i + 1; > + else > + *secondary_mpart = i + 1; > + } > + } > + > + if (mparts != 2) { > + log_err("Expect two copies of the metadata instead of %d\n", > + mparts); > + ret = -EINVAL; > + } else { > + ret = 0; > + } > +out: > + free(gpt_pte); > + > + return ret; > +} > + > +static int gpt_get_metadata_disk_part(struct blk_desc *desc, > + struct disk_partition *info, > + u32 part_num) > +{ > + int ret; > + char *metadata_guid_str = "8a7a84a0-8387-40f6-ab41-a8b9a5a60d23"; Is this hard-code guid_string intentioned? > + > + ret = part_get_info(desc, part_num, info); Jason Liu smime.p7s Description: S/MIME cryptographic signature
RE: [PATCH 8/8] imx: convert mx53loco board to DM_VIDEO
> -Original Message- > From: Anatolij Gustschin > Sent: Tuesday, May 26, 2020 7:42 AM > To: u-boot@lists.denx.de > Cc: Jason Liu > Subject: [PATCH 8/8] imx: convert mx53loco board to DM_VIDEO > > Migration to DM_VIDEO driver is long overdue. Update defconfig to enable > usage of converted ipuv3 driver DM configuration. > > Signed-off-by: Anatolij Gustschin > Cc: Jason Liu > --- > configs/mx53loco_defconfig | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Acked-by: Jason Liu > > diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig index > e5d842a75d..40fab2016c 100644 > --- a/configs/mx53loco_defconfig > +++ b/configs/mx53loco_defconfig > @@ -37,7 +37,12 @@ CONFIG_USB_HOST_ETHER=y > CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_MCS7830=y > CONFIG_USB_ETHER_SMSC95XX=y > +CONFIG_DM_VIDEO=y > CONFIG_VIDEO_IPUV3=y > -CONFIG_VIDEO=y > -# CONFIG_VIDEO_SW_CURSOR is not set > +# CONFIG_BACKLIGHT is not set > +# CONFIG_VIDEO_BPP8 is not set > +# CONFIG_VIDEO_BPP32 is not set > +# CONFIG_VIDEO_ANSI is not set > +# CONFIG_PANEL is not set > +CONFIG_SYS_WHITE_ON_BLACK=y > CONFIG_OF_LIBFDT=y > -- > 2.17.1
Re: [U-Boot] [v3, 3/5] Convert to use fsl_esdhc_imx for i.MX platforms
> -Original Message- > From: Y.b. Lu > Sent: Tuesday, May 21, 2019 4:52 PM > To: u-boot@lists.denx.de > Cc: Stefano Babic ; Fabio Estevam ; > dl-uboot-imx ; Albert Aribaud > ; Eddy Petrișor ; > Akshay Bhat ; Ken Lin > ; Heiko Schocher ; Christian > Gmeiner ; Stefan Roese ; Patrick > Bruenn ; Troy Kisky > ; Uri Mashiach > ; Nikita Kiryanov ; > Otavio Salvador ; Andreas Geisreiter > ; Ludwig Zenz ; Eric > Bénard ; Peng Fan ; Jason Liu > ; Ye Li ; Adrian Alonso > ; Alison Wang ; > thar...@gateworks.com; Ian Ray ; Marcin Niestroj > ; Andrej Rosano ; > Marek Vasut ; Lukasz Majewski ; Adam > Ford ; Olaf Mandel ; > Martyn Welch ; Ingo Schroeck > ; Boris Brezillon > ; Soeren Moch ; > Richard Hu ; Vanessa Maegima > ; Max Krummenacher > ; Stefan Agner > ; Markus Niebel ; > Breno Matheus Lima ; Francesco Montefoschi > ; Parthiban Nallathambi > ; Albert ARIBAUD ; Jagan Teki > ; Raffaele RECALCATI > ; Simone CIANNI ; > Bhaskar Upadhaya ; Vinitha V Pillai > ; Prabhakar Kushwaha > ; Rajesh Bhagat ; > Antti Mäentausta ; Sébastien Szymanski > ; Lucile Quirion > ; Alexey Brodkin > ; Trevor Woerner ; Anatolij > Gustschin ; Denis Zalevskiy ; Fabien > Lahoudere ; Joe Hershberger > ; Simon Goldschmidt > ; James Byrne > ; Angelo Dureghello ; Y.b. > Lu > Subject: [v3, 3/5] Convert to use fsl_esdhc_imx for i.MX platforms > > Converted to use fsl_esdhc_imx for i.MX platforms. > > Signed-off-by: Yangbo Lu > --- > Changes for v2: > - Rebased. > Changes for v3: > - Rebased. > --- > arch/arm/cpu/arm1136/mx35/generic.c | 10 +- > arch/arm/cpu/arm926ejs/mx25/generic.c | 8 > arch/arm/cpu/armv7/vf610/generic.c| 10 +- > arch/arm/cpu/armv8/s32v234/generic.c | 2 +- > arch/arm/include/asm/global_data.h| 2 +- > arch/arm/mach-imx/cpu.c | 6 +++--- > arch/arm/mach-imx/mx6/litesom.c | 4 ++-- > arch/arm/mach-imx/mx7/clock.c | 4 ++-- > arch/arm/mach-imx/mx7ulp/clock.c | 2 +- > arch/arm/mach-imx/speed.c | 4 ++-- > board/advantech/dms-ba16/dms-ba16.c | 4 ++-- > board/aristainetos/aristainetos-v1.c | 2 +- > board/aristainetos/aristainetos-v2.c | 2 +- > board/aristainetos/aristainetos.c | 4 ++-- > board/bachmann/ot1200/ot1200.c| 2 +- > board/barco/platinum/platinum.c | 2 +- > board/barco/titanium/titanium.c | 4 ++-- > board/beckhoff/mx53cx9020/mx53cx9020.c| 4 ++-- > board/boundary/nitrogen6x/nitrogen6x.c| 4 ++-- > board/ccv/xpress/xpress.c | 2 +- > board/compulab/cl-som-imx7/cl-som-imx7.c | 6 +++--- > board/compulab/cl-som-imx7/common.c | 6 +++--- > board/compulab/cl-som-imx7/common.h | 8 > board/compulab/cl-som-imx7/mux.c | 8 > board/compulab/cl-som-imx7/spl.c | 6 +++--- > board/compulab/cm_fx6/cm_fx6.c| 4 ++-- > board/compulab/cm_fx6/common.c| 4 ++-- > board/compulab/cm_fx6/spl.c | 2 +- > board/congatec/cgtqmx6eval/cgtqmx6eval.c | 4 ++-- > board/dhelectronics/dh_imx6/dh_imx6.c | 4 ++-- > board/dhelectronics/dh_imx6/dh_imx6_spl.c | 2 +- > board/el/el6x/el6x.c | 4 ++-- > board/embest/mx6boards/mx6boards.c| 4 ++-- > board/freescale/imx8mq_evk/imx8mq_evk.c | 2 +- > board/freescale/imx8mq_evk/spl.c | 2 +- > board/freescale/imx8qxp_mek/imx8qxp_mek.c | 2 +- > board/freescale/mx25pdk/mx25pdk.c | 6 +++--- > board/freescale/mx35pdk/mx35pdk.c | 4 ++-- > board/freescale/mx51evk/mx51evk.c | 6 +++--- > board/freescale/mx53ard/mx53ard.c | 4 ++-- > board/freescale/mx53evk/mx53evk.c | 4 ++-- > board/freescale/mx53loco/mx53loco.c | 4 ++-- > board/freescale/mx53smd/mx53smd.c | 4 ++-- > board/freescale/mx6qarm2/mx6qarm2.c | 4 ++-- > board/freescale/mx6sabreauto/mx6sabreauto.c | 4 ++-- > board/freescale/mx6sabresd/mx6sabresd.c | 4 ++-- > board/freescale/mx6slevk/mx6slevk.c | 2 +- > board/freescale/mx6sxsabreauto/mx6sxsabreauto.c | 2 +- > board/freescale/mx6sxsabresd/mx6sxsabresd.c | 2 +- > board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 4 ++-- > board/freesc
Re: [U-Boot] [v3, 1/5] Move CONFIG_FSL_ESDHC to defconfig
> -Original Message- > From: Y.b. Lu > Sent: Tuesday, May 21, 2019 4:52 PM > To: u-boot@lists.denx.de > Cc: Stefano Babic ; Fabio Estevam ; > dl-uboot-imx ; Albert Aribaud > ; Eddy Petrișor ; > Akshay Bhat ; Ken Lin > ; Heiko Schocher ; Christian > Gmeiner ; Stefan Roese ; Patrick > Bruenn ; Troy Kisky > ; Uri Mashiach > ; Nikita Kiryanov ; > Otavio Salvador ; Andreas Geisreiter > ; Ludwig Zenz ; Eric > Bénard ; Peng Fan ; Jason Liu > ; Ye Li ; Adrian Alonso > ; Alison Wang ; > thar...@gateworks.com; Ian Ray ; Marcin Niestroj > ; Andrej Rosano ; > Marek Vasut ; Lukasz Majewski ; Adam > Ford ; Olaf Mandel ; > Martyn Welch ; Ingo Schroeck > ; Boris Brezillon > ; Soeren Moch ; > Richard Hu ; Vanessa Maegima > ; Max Krummenacher > ; Stefan Agner > ; Markus Niebel ; > Breno Matheus Lima ; Francesco Montefoschi > ; Parthiban Nallathambi > ; Albert ARIBAUD ; Jagan Teki > ; Raffaele RECALCATI > ; Simone CIANNI ; > Bhaskar Upadhaya ; Vinitha V Pillai > ; Prabhakar Kushwaha > ; Rajesh Bhagat ; > Antti Mäentausta ; Sébastien Szymanski > ; Lucile Quirion > ; Alexey Brodkin > ; Trevor Woerner ; Anatolij > Gustschin ; Denis Zalevskiy ; Fabien > Lahoudere ; Joe Hershberger > ; Simon Goldschmidt > ; James Byrne > ; Angelo Dureghello ; Y.b. > Lu > Subject: [v3, 1/5] Move CONFIG_FSL_ESDHC to defconfig > > Moved CONFIG_FSL_ESDHC from header files to defconfig files. > > Signed-off-by: Yangbo Lu > --- > Changes for v2: > - Rebased. > Changes for v3: > - Rebased. > --- > configs/imx8mq_evk_defconfig | 1 + > configs/imx8qm_mek_defconfig | 1 + > configs/imx8qxp_mek_defconfig | 1 + > configs/kp_imx6q_tpc_defconfig | 1 + > configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 + > configs/ls1012afrwy_qspi_defconfig | 1 + > configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig | 1 + > configs/ls1012afrwy_tfa_defconfig | 1 + > include/configs/imx8mq_evk.h | 1 - > include/configs/imx8qm_mek.h | 1 - > include/configs/imx8qxp_mek.h | 1 - > include/configs/kp_imx6q_tpc.h | 1 - > include/configs/ls1012afrwy.h | 1 - > 13 files changed, 8 insertions(+), 5 deletions(-) Acked-by: Jason Liu > > -- > 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] i.MX6: Add ANATOP regulator init
2012/4/13 Dirk Behme dirk.be...@de.bosch.com: Init the core regulator voltage to 1.2V. This is required for the correct functioning of the GPU and when the ARM LDO is set to 1.225V. This is a workaround to fix some memory clock jitter. Note: This should be but can't be done in the DCD. The bootloader prevents access to the ANATOP registers. Signed-off-by: Dirk Behme dirk.be...@de.bosch.com CC: Jason Chen b02...@freescale.com CC: Jason Liu r64...@freescale.com CC: Ranjani Vaidyanathan ra5...@freescale.com CC: Stefano Babic sba...@denx.de CC: Fabio Estevam feste...@gmail.com --- arch/arm/cpu/armv7/mx6/soc.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index 543b2cc..957ea34 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -77,10 +77,26 @@ void init_aips(void) writel(0x, aips2-opacr4); } +static void init_anatop_reg(void) +{ + struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; + int reg = readl(anatop-reg_core); + + /* + * Increase the VDDSOC to 1.2V + * Mask out the REG_CORE[22:18] bits (REG2_TRIG) + * and set them to 1.2V (0.7V + 0x14 * 0.025V) + */ + reg = (reg ~(0x1F 18)) | (0x14 18); + writel(reg, anatop-reg_core); +} + int arch_cpu_init(void) { init_aips(); + init_anatop_reg(); + return 0; } #endif Acked-by:Jason Liu r64...@freescale.com -- 1.7.0.4 ___ 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] i.mx: i.mx6x: NO_MUX_I/NO_PAD_I not set correctly
If one PAD does not have mux or pad config register, we need set the NO_MUX_I/NO_PAD_I to 0, the old value is not correct Signed-off-by: Jason Liu jason@linaro.org CC: Stefano Babic sba...@denx.de --- arch/arm/include/asm/arch-mx6/mx6x_pins.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-mx6/mx6x_pins.h b/arch/arm/include/asm/arch-mx6/mx6x_pins.h index afaa068..9979651 100644 --- a/arch/arm/include/asm/arch-mx6/mx6x_pins.h +++ b/arch/arm/include/asm/arch-mx6/mx6x_pins.h @@ -48,8 +48,8 @@ #define PAD_CTL_SRE_FAST (1 0) #define PAD_CTL_SRE_SLOW (0 0) -#define NO_MUX_I 0x3FF -#define NO_PAD_I 0x7FF +#define NO_MUX_I0 +#define NO_PAD_I0 enum { MX6Q_PAD_SD2_DAT1__USDHC2_DAT1 = IOMUX_PAD(0x0360, 0x004C, 0, 0x, 0, 0), -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/5] mx53loco: Use gpio_direction_input prior to gpio_get_value
2012/2/8 Fabio Estevam feste...@gmail.com: Use gpio_direction_input prior to gpio_get_value. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Jason Liu r64...@freescale.com --- board/freescale/mx53loco/mx53loco.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index e6345e7..c2c26f0 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -153,7 +153,9 @@ int board_mmc_getcd(struct mmc *mmc) int ret; mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1); + gpio_direction_input(75); mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1); + gpio_direction_input(77); if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) ret = !gpio_get_value(77); /* GPIO3_13 */ -- 1.7.1 ___ 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
Re: [U-Boot] [PATCH 3/5] mx53evk: Use gpio_direction_input prior to gpio_get_value
2012/2/8 Fabio Estevam feste...@gmail.com: Use gpio_direction_input prior to gpio_get_value. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Jason Liu r64...@freescale.com --- board/freescale/mx53evk/mx53evk.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index e976ae1..8a6e31d 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -214,7 +214,9 @@ int board_mmc_getcd(struct mmc *mmc) int ret; mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1); + gpio_direction_input(75); mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1); + gpio_direction_input(77); if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) ret = !gpio_get_value(77); /* GPIO3_13 */ -- 1.7.1 ___ 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
Re: [U-Boot] [PATCH 1/1] MX5:MX53: support for Freescale MX53LOCO
Bud, 2012/2/3 Bud Miljkovic bud_miljko...@trimble.com: Hi Stefano, I have cloned yesterday http://git.denx.de/u-boot.git on to my local machine and from there selected the v2011.12-rc3 tag. Then I configured the mx53loco board and successfully build u-boot.imx, copied the image to a SD card and powered it up. What I then got on the serial port terminal was as follows: U-Boot 2011.12-00201-g137703b (Feb 03 2012 - 11:12:00) CPU: Freescale i.MX53 family rev2.1 at 800 MHz Reset cause: POR Board: MX53 LOCO DRAM: 1 GiB WARNING: Caches not enabled MMC: FSL_SDHC: 0, FSL_SDHC: 1 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: At this point, having printed Net: the program hags. I have fixed this issue by a recent commit which is queened in u-boot-imx and you can refer to the patch here: http://patchwork.ozlabs.org/patch/138761/ Jason ___ 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] i.mx: i.mx5: update imx_get_mac_from_fuse function
FEC does not work on the i.mx51/53evk board, it will hangup In:serial Out: serial Err: serial Net: After bisect, it due to the following commit: be252b6 net: imx: Add multi-FEC support for imx_get_mac_from_fuse has change the imx_get_mac_from_fuse fucntion prototype, but fail to update i.mx5, here it does it. After apply this patch, u-boot works again on i.mx51/53 evk boards. Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de --- arch/arm/cpu/armv7/mx5/soc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c index 1533dd8..3f5a4f7 100644 --- a/arch/arm/cpu/armv7/mx5/soc.c +++ b/arch/arm/cpu/armv7/mx5/soc.c @@ -72,7 +72,7 @@ u32 get_cpu_rev(void) } #if defined(CONFIG_FEC_MXC) -void imx_get_mac_from_fuse(unsigned char *mac) +void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) { int i; struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/3] mxc_spi refactoring (for mx6q and mx6qsabrelite)
Eric, 2012/1/31 Eric Nelson eric.nel...@boundarydevices.com: This patch set refactors mxc_spi as described in http://lists.denx.de/pipermail/u-boot/2010-March/068791.html and requested in http://lists.denx.de/pipermail/u-boot/2012-January/116023.html in order to add support for the MX6Q in general and the mx6qsabrelite specifically. If this patch-set is re-send, please specify version Vx and change-log. Thanks, Patch 1 simply moves the conditional parts of mxc_spi.c into the respective CPU-specific imx-regs.h files. Patch 2 adds general support for SPI to the i.MX6. I can't find the patch 2/3 in my email system, miss it? Patch 3 adds support to the mx6qsabrelite board ___ 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] imx: mx6q: add aipstz init for off platform periph
Init peripheral access control register of AIPSTZ OPACRx: Buffer Writes(BW): 0 - not bufferable, Supervisor Protect(SP): 0 - not require supervisor privilege level for accesses. Write Protect(WP): 0 - allows write accesses. Trusted Protect(TP):0 - allows unstrusted master Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de --- arch/arm/cpu/armv7/mx6/soc.c | 29 +++-- arch/arm/include/asm/arch-mx6/imx-regs.h | 11 +++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index bd59cf5..bec53cd 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -40,18 +40,35 @@ u32 get_cpu_rev(void) #ifdef CONFIG_ARCH_CPU_INIT void init_aips(void) { - u32 reg = AIPS1_BASE_ADDR; + struct aipstz_regs *aips1, *aips2; + + aips1 = (struct aipstz_regs *)AIPS1_BASE_ADDR; + aips2 = (struct aipstz_regs *)AIPS2_BASE_ADDR; /* * Set all MPROTx to be non-bufferable, trusted for R/W, * not forced to user-mode. */ - writel(0x, reg + 0x00); - writel(0x, reg + 0x04); + writel(0x, aips1-mprot0); + writel(0x, aips1-mprot1); + writel(0x, aips2-mprot0); + writel(0x, aips2-mprot1); - reg = AIPS2_BASE_ADDR; - writel(0x, reg + 0x00); - writel(0x, reg + 0x04); + /* +* Set all OPACRx to be non-bufferable, not require +* supervisor privilege level for access,allow for +* write access and untrusted master access. +*/ + writel(0x, aips1-opacr0); + writel(0x, aips1-opacr1); + writel(0x, aips1-opacr2); + writel(0x, aips1-opacr3); + writel(0x, aips1-opacr4); + writel(0x, aips2-opacr0); + writel(0x, aips2-opacr1); + writel(0x, aips2-opacr2); + writel(0x, aips2-opacr3); + writel(0x, aips2-opacr4); } int arch_cpu_init(void) diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 5fe9748..7650cb9 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -232,5 +232,16 @@ struct fuse_bank4_regs { u32 rsvd3[0x13]; }; +struct aipstz_regs { + u32 mprot0; + u32 mprot1; + u32 rsvd[0xe]; + u32 opacr0; + u32 opacr1; + u32 opacr2; + u32 opacr3; + u32 opacr4; +}; + #endif /* __ASSEMBLER__*/ #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */ -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/4] mmc: fsl_esdhc: Implement card-detect hook.
2012/1/2 Thierry Reding thierry.red...@avionic-design.de: This card-detect hook probably doesn't work. Perhaps somebody with more knowledge about the hardware can comment on this. I think that perhaps even the complete code from esdhc_init() could go into the getcd() function instead or mmc_getcd() needs to be called at some later time after mmc_init(), which, however, would require many other drivers to change. yes, the hook in the patch does not work for the fsl i.mx sdhc controller due to silicon issues and we need always use gpio to read the card detection status. In addition to implementing the hook, this patch also removes the call to the board_mmc_getcd() function which is now called from the MMC framework and is no longer required here. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- Tested ok on i.mx51evk board, Tested-by: Jason Liu jason@linaro.org drivers/mmc/fsl_esdhc.c | 29 - 1 files changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index f038acc..1ed5355 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -418,7 +418,6 @@ static int esdhc_init(struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg-esdhc_base; int timeout = 1000; - int ret = 0; /* Reset the entire host controller */ esdhc_write32(regs-sysctl, SYSCTL_RSTA); @@ -445,24 +444,19 @@ static int esdhc_init(struct mmc *mmc) /* Set timout to the maximum value */ esdhc_clrsetbits32(regs-sysctl, SYSCTL_TIMEOUT_MASK, 14 16); - /* Check if there is a callback for detecting the card */ - ret = board_mmc_getcd(mmc); - if (ret 0) { - timeout = 1000; - while (!(esdhc_read32(regs-prsstat) PRSSTAT_CINS) - --timeout) - udelay(1000); + return 0; +} - if (timeout = 0) - ret = NO_CARD_ERR; - } else { - if (ret == 0) - ret = NO_CARD_ERR; - else - ret = 0; - } +static int esdhc_getcd(struct mmc *mmc) +{ + struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; + struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg-esdhc_base; + int timeout = 1000; + + while (!(esdhc_read32(regs-prsstat) PRSSTAT_CINS) --timeout) + udelay(1000); - return ret; + return timeout 0; } static void esdhc_reset(struct fsl_esdhc *regs) @@ -500,6 +494,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) mmc-send_cmd = esdhc_send_cmd; mmc-set_ios = esdhc_set_ios; mmc-init = esdhc_init; + mmc-getcd = esdhc_getcd; voltage_caps = 0; caps = regs-hostcapblt; -- 1.7.8.1 ___ 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
Re: [U-Boot] [PATCH v4 1/4] mmc: Change board_mmc_getcd() function prototype.
2012/1/2 Thierry Reding thierry.red...@avionic-design.de: The new API no longer uses the extra cd parameter that was used to store the card presence state. Instead, this information is returned via the function's return value. board_mmc_getcd() returns -1 to indicate that no card-detection mechanism is implemented; 0 indicates that no card is present and 1 is returned if it was detected that a card is present. The rationale for this change can be found in the following email thread: http://lists.denx.de/pipermail/u-boot/2011-November/110180.html In summary, the old API was not consistent with the rest of the MMC API which always passes a struct mmc as the first parameter. Furthermore the cd parameter was used to mean card absence in some implementations and card presence in others. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- board/efikamx/efikamx.c | 9 + board/emk/top9000/top9000.c | 12 ++-- board/freescale/mx51evk/mx51evk.c | 9 + board/freescale/mx53ard/mx53ard.c | 9 + board/freescale/mx53evk/mx53evk.c | 9 + board/freescale/mx53loco/mx53loco.c | 9 + board/freescale/mx53smd/mx53smd.c | 6 ++ doc/README.atmel_mci | 12 ++-- drivers/mmc/fsl_esdhc.c | 8 +--- drivers/mmc/mmc.c | 4 ++-- include/mmc.h | 2 +- 11 files changed, 39 insertions(+), 50 deletions(-) Tested ok on i.mx51evk board, Tested-by: Jason Liu jason@linaro.org [...] ___ 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
Re: [U-Boot] [PATCH v4 2/4] mmc: Implement card detection.
2012/1/2 Thierry Reding thierry.red...@avionic-design.de: Check for card detect each time an MMC/SD device is initialized. If card detection is not implemented, this code behaves as before and continues assuming a card is present. If no card is detected, has_init is reset for the MMC/SD device (to force initialization next time) and an error is returned. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- drivers/mmc/arm_pl180_mmci.c | 1 + drivers/mmc/bfin_sdh.c | 1 + drivers/mmc/davinci_mmc.c | 1 + drivers/mmc/ftsdc010_esdhc.c | 1 + drivers/mmc/gen_atmel_mci.c | 1 + drivers/mmc/mmc.c | 18 ++ drivers/mmc/mmc_spi.c | 1 + drivers/mmc/mxcmmc.c | 1 + drivers/mmc/mxsmmc.c | 1 + drivers/mmc/omap_hsmmc.c | 1 + drivers/mmc/pxa_mmc_gen.c | 1 + drivers/mmc/s5p_mmc.c | 1 + drivers/mmc/sdhci.c | 1 + drivers/mmc/sh_mmcif.c | 1 + include/mmc.h | 2 ++ 15 files changed, 33 insertions(+), 0 deletions(-) Tested ok on i.mx51evk board, Tested-by: Jason Liu jason@linaro.org [...] -- 1.7.8.1 ___ 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
Re: [U-Boot] [PATCH] i.mx6:imx6q: allign MAC address with burned-in ordering
Stefano, 2011/12/19 Jason Liu jason@linaro.org: For the i.mx6q, the burned-in MAC address will be the following odering, fuse: 0x620[7:0] MAC_ADDR[7:0] --- mac[5] fuse: 0x620[15:8] MAC_ADDR[15:8] --- mac[4] fuse: 0x620[23:16] MAC_ADDR[23:16] --- mac[3] fuse: 0x620[31:24] MAC_ADDR[31:24] --- mac[2] fuse: 0x630[7:0] MAC_ADDR[39:32] --- mac[1] fuse: 0x630[15:8] MAC_ADDR[47:40] --- mac[0] This patch also fix the error caculation for the fuse bank[0] address Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de --- arch/arm/cpu/armv7/mx6/soc.c | 14 -- arch/arm/include/asm/arch-mx6/imx-regs.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index dff5e4e..bd59cf5 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -70,13 +70,15 @@ void imx_get_mac_from_fuse(unsigned char *mac) struct fuse_bank4_regs *fuse = (struct fuse_bank4_regs *)bank-fuse_regs; - u32 mac_lo = readl(fuse-mac_addr_low); - u32 mac_hi = readl(fuse-mac_addr_high); + u32 value = readl(fuse-mac_addr_high); + mac[0] = (value 8); + mac[1] = value ; - *(u32 *)mac = mac_lo; - - mac[4] = mac_hi 0xff; - mac[5] = (mac_hi 8) 0xff; + value = readl(fuse-mac_addr_low); + mac[2] = value 24 ; + mac[3] = value 16 ; + mac[4] = value 8 ; + mac[5] = value ; } #endif diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 85d55b7..5fe9748 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -214,7 +214,7 @@ struct iim_regs { u32 crc_value; u32 rsvd6[3]; u32 version; - u32 rsvd7[0xd8]; + u32 rsvd7[0xdb]; struct fuse_bank { u32 fuse_regs[0x20]; Ping. Any comments? -- 1.7.4.1 ___ 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
Re: [U-Boot] [PATCH] i.mx6q: mx6qarm2: Enable the usboh3 clock
2011/12/26 Dirk Behme dirk.be...@googlemail.com: From: Eric Nelson eric.nel...@boundarydevices.com Bits 0 and 1 of CCM_CCGR7 are the usboh3 clock enable bits. Enabling this clock is necessary for the USB download. Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com CC: Jason Hui jason@linaro.org Acked-by: Jason Hui jason@linaro.org --- board/freescale/mx6qarm2/imximage.cfg | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/board/freescale/mx6qarm2/imximage.cfg b/board/freescale/mx6qarm2/imximage.cfg index ffac1b4..5f0ee0d 100644 --- a/board/freescale/mx6qarm2/imximage.cfg +++ b/board/freescale/mx6qarm2/imximage.cfg @@ -164,4 +164,4 @@ DATA 4 0x020c4070 0x0FFFC000 DATA 4 0x020c4074 0x3FF0 DATA 4 0x020c4078 0x00FFF300 DATA 4 0x020c407c 0x0FC3 -DATA 4 0x020c4080 0x03FC +DATA 4 0x020c4080 0x03FF -- 1.7.7.4 ___ 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] i.mx6:imx6q: allign MAC address with burned-in ordering
For the i.mx6q, the burned-in MAC address will be the following odering, fuse: 0x620[7:0] MAC_ADDR[7:0] --- mac[5] fuse: 0x620[15:8] MAC_ADDR[15:8]--- mac[4] fuse: 0x620[23:16] MAC_ADDR[23:16] --- mac[3] fuse: 0x620[31:24] MAC_ADDR[31:24] --- mac[2] fuse: 0x630[7:0] MAC_ADDR[39:32] --- mac[1] fuse: 0x630[15:8] MAC_ADDR[47:40] --- mac[0] This patch also fix the error caculation for the fuse bank[0] address Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de --- arch/arm/cpu/armv7/mx6/soc.c | 14 -- arch/arm/include/asm/arch-mx6/imx-regs.h |2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index dff5e4e..bd59cf5 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -70,13 +70,15 @@ void imx_get_mac_from_fuse(unsigned char *mac) struct fuse_bank4_regs *fuse = (struct fuse_bank4_regs *)bank-fuse_regs; - u32 mac_lo = readl(fuse-mac_addr_low); - u32 mac_hi = readl(fuse-mac_addr_high); + u32 value = readl(fuse-mac_addr_high); + mac[0] = (value 8); + mac[1] = value ; - *(u32 *)mac = mac_lo; - - mac[4] = mac_hi 0xff; - mac[5] = (mac_hi 8) 0xff; + value = readl(fuse-mac_addr_low); + mac[2] = value 24 ; + mac[3] = value 16 ; + mac[4] = value 8 ; + mac[5] = value ; } #endif diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 85d55b7..5fe9748 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -214,7 +214,7 @@ struct iim_regs { u32 crc_value; u32 rsvd6[3]; u32 version; - u32 rsvd7[0xd8]; + u32 rsvd7[0xdb]; struct fuse_bank { u32 fuse_regs[0x20]; -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] __mmc_get_env_addr() is not being called?
2011/12/16 Stefano Babic sba...@denx.de: On 16/12/2011 06:54, Shawn Guo wrote: Hi, Hi Shawn, I'm running v2011.12-rc1 (with one missing usdhc patch applied) on mx6qarm2 board, and seeing a problem. When I install u-boot on a blank SD card, it boots fine with messge *** Warning - bad CRC, using default environment seen as expected. But once I run command 'save' to write envs to the card, the card stop booting. I tracked the issue a little bit, and found __mmc_get_env_addr() does not get called at all. Therefore when I run 'save' for the first time, the envs are written to offset 0 of the card, which in turn overwrites the boot image. I have not figured out why it does. But the following change fixes the problem for me. diff --git a/common/env_mmc.c b/common/env_mmc.c index 8441c77..3832fe4 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -46,13 +46,11 @@ DECLARE_GLOBAL_DATA_PTR; #define CONFIG_ENV_OFFSET 0 #endif -static int __mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) +static int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) { *env_addr = CONFIG_ENV_OFFSET; return 0; } -int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) - __attribute__((weak, alias(__mmc_get_env_addr))); Any comment on why the change fixes the problem is appreciated. The function is declared weak, this means that a specific architecture could implement its own version. The reason why it does not work is that there is a specific implementation in board/freescale/sdhc_boot.c, and the mmc_get_env_addr() in this file is taken instead of the default when CONFIG_ENV_IS_IN_MMC (as in our case) is set. Instead of your proposal, we should surround mmc_get_env_addr() in sdhc_boot.c with something like #ifndef CONFIG_MX6Q, or check if we can reuse this function, that really does not use CONFIG_ENV_OFFSET at all. I put Jason (board maintainer) in CC - Jason, what do mind ? Do you get the same issue when you tested the board ? Stefano, I saw the issue. Fabio's patch can fix the i.mx28evk issue, but can't fix the following platforms: 11144 include/configs/efikamx.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 12 86 include/configs/mx51evk.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 13 58 include/configs/mx53ard.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 14 68 include/configs/mx53evk.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 15 51 include/configs/mx53loco.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 16 58 include/configs/mx53smd.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 17 48 include/configs/mx6qarm2.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 18 48 include/configs/mx6qsabrelite.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC 20105 include/configs/vision2.h CONFIG_FSL_ESDHC #define CONFIG_FSL_ESDHC The commit 97039ab98 (env_mmc: Allow board code to override the environment address) break the i.mx5/6 boards support. BR, Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/3] i.mx6q: Add the ethernet function support
This patch add the ethernet function support for i.mx6q/arm2 board. The patch has been tested ok by: Dirk Behme dirk.be...@de.bosch.com on freescale i.mx6qarm2 board. Jason Liu (3): i.mx: i.mx6q: Add the enet clock function fec: add the i.mx6q enet driver support i.mx6q: arm2: Add the enet function support arch/arm/cpu/armv7/mx6/clock.c |5 ++ board/freescale/mx6qarm2/mx6qarm2.c | 90 +++ drivers/net/fec_mxc.c | 10 drivers/net/fec_mxc.h |7 ++- include/configs/mx6qarm2.h | 12 - 5 files changed, 121 insertions(+), 3 deletions(-) -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/3] i.mx: i.mx6q: Add the enet clock function
Cc: Stefano Babic sba...@denx.de Signed-off-by: Jason Liu jason@linaro.org Acked-by: Stefano Babic sba...@denx.de --- v2: Add Stefano's ack --- arch/arm/cpu/armv7/mx6/clock.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c index b143535..fa3a124 100644 --- a/arch/arm/cpu/armv7/mx6/clock.c +++ b/arch/arm/cpu/armv7/mx6/clock.c @@ -285,6 +285,11 @@ u32 imx_get_uartclk(void) return get_uart_clk(); } +u32 imx_get_fecclk(void) +{ + return decode_pll(PLL_ENET, CONFIG_SYS_MX6_HCLK); +} + unsigned int mxc_get_clock(enum mxc_clock clk) { switch (clk) { -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/3] fec: add the i.mx6q enet driver support
Cc: Stefano Babic sba...@denx.de Signed-off-by: Jason Liu jason@linaro.org Acked-by: Stefano Babic sba...@denx.de --- v2: Add Stefano's ack --- drivers/net/fec_mxc.c | 10 ++ drivers/net/fec_mxc.h |7 ++- 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index b05a4c0..3affda8 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -384,6 +384,14 @@ static int fec_open(struct eth_device *edev) writel(1 2, fec-eth-x_cntrl); fec-rbd_index = 0; +#if defined(CONFIG_MX6Q) + /* Enable ENET HW endian SWAP */ + writel(readl(fec-eth-ecntrl) | FEC_ECNTRL_DBSWAP, + fec-eth-ecntrl); + /* Enable ENET store and forward mode */ + writel(readl(fec-eth-x_wmrk) | FEC_X_WMRK_STRFWD, + fec-eth-x_wmrk); +#endif /* * Enable FEC-Lite controller */ @@ -485,6 +493,8 @@ static int fec_init(struct eth_device *dev, bd_t* bd) rcntrl = PKTSIZE FEC_RCNTRL_MAX_FL_SHIFT; if (fec-xcv_type == SEVENWIRE) rcntrl |= FEC_RCNTRL_FCE; + else if (fec-xcv_type == RGMII) + rcntrl |= FEC_RCNTRL_RGMII; else if (fec-xcv_type == RMII) rcntrl |= FEC_RCNTRL_RMII; else/* MII mode */ diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h index 8b26645..39337bf 100644 --- a/drivers/net/fec_mxc.h +++ b/drivers/net/fec_mxc.h @@ -196,6 +196,7 @@ struct ethernet_regs { #define FEC_RCNTRL_PROM0x0008 #define FEC_RCNTRL_BC_REJ 0x0010 #define FEC_RCNTRL_FCE 0x0020 +#define FEC_RCNTRL_RGMII 0x0040 #define FEC_RCNTRL_RMII0x0100 #define FEC_TCNTRL_GTS 0x0001 @@ -206,6 +207,9 @@ struct ethernet_regs { #define FEC_ECNTRL_RESET 0x0001 /* reset the FEC */ #define FEC_ECNTRL_ETHER_EN0x0002 /* enable the FEC */ +#define FEC_ECNTRL_DBSWAP 0x0100 + +#define FEC_X_WMRK_STRFWD 0x0100 #if defined(CONFIG_MX25) || defined(CONFIG_MX53) /* defines for MIIGSK */ @@ -261,7 +265,8 @@ enum xceiver_type { SEVENWIRE, /* 7-wire */ MII10, /* MII 10Mbps */ MII100, /* MII 100Mbps */ - RMII/* RMII */ + RMII, /* RMII */ + RGMII, /* RGMII */ }; /** -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 3/3] i.mx6q: arm2: Add the enet function support
This enable the network function on the i.mx6q armadillo2 board(arm2), thus we can use tftp to load image from network. Cc: Stefano Babic sba...@denx.de Signed-off-by: Jason Liu jason@linaro.org Tested-by: Dirk Behme dirk.be...@de.bosch.com --- v2: use constant define and remove ETHPRIME config --- board/freescale/mx6qarm2/mx6qarm2.c | 90 +++ include/configs/mx6qarm2.h | 12 - 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c index 89e0e76..9894245 100644 --- a/board/freescale/mx6qarm2/mx6qarm2.c +++ b/board/freescale/mx6qarm2/mx6qarm2.c @@ -29,6 +29,8 @@ #include asm/gpio.h #include mmc.h #include fsl_esdhc.h +#include miiphy.h +#include netdev.h DECLARE_GLOBAL_DATA_PTR; @@ -40,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | \ PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) +#define ENET_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |\ + PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_HYS) + int dram_init(void) { gd-ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); @@ -79,11 +85,35 @@ iomux_v3_cfg_t usdhc4_pads[] = { MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), }; +iomux_v3_cfg_t enet_pads[] = { + MX6Q_PAD_KEY_COL1__ENET_MDIO| MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_KEY_COL2__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), +}; + + static void setup_iomux_uart(void) { imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads)); } +static void setup_iomux_enet(void) +{ + imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); +} + #ifdef CONFIG_FSL_ESDHC struct fsl_esdhc_cfg usdhc_cfg[2] = { {USDHC3_BASE_ADDR, 1}, @@ -132,9 +162,69 @@ int board_mmc_init(bd_t *bis) } #endif +#define MII_MMD_ACCESS_CTRL_REG0xd +#define MII_MMD_ACCESS_ADDR_DATA_REG 0xe +#define MII_DBG_PORT_REG 0x1d +#define MII_DBG_PORT2_REG 0x1e + +int fecmxc_mii_postcall(int phy) +{ + unsigned short val; + + /* +* Due to the i.MX6Q Armadillo2 board HW design,there is +* no 125Mhz clock input from SOC. In order to use RGMII, +* We need enable AR8031 ouput a 125MHz clk from CLK_25M +*/ + miiphy_write(FEC, phy, MII_MMD_ACCESS_CTRL_REG, 0x7); + miiphy_write(FEC, phy, MII_MMD_ACCESS_ADDR_DATA_REG, 0x8016); + miiphy_write(FEC, phy, MII_MMD_ACCESS_CTRL_REG, 0x4007); + miiphy_read(FEC, phy, MII_MMD_ACCESS_ADDR_DATA_REG, val); + val = 0xffe3; + val |= 0x18; + miiphy_write(FEC, phy, MII_MMD_ACCESS_ADDR_DATA_REG, val); + + /* For the RGMII phy, we need enable tx clock delay */ + miiphy_write(FEC, phy, MII_DBG_PORT_REG, 0x5); + miiphy_read(FEC, phy, MII_DBG_PORT2_REG, val); + val |= 0x0100; + miiphy_write(FEC, phy, MII_DBG_PORT2_REG, val); + + miiphy_write(FEC, phy, MII_BMCR, 0xa100); + + return 0; +} + +int board_eth_init(bd_t *bis) +{ + struct eth_device *dev; + int ret; + + ret = cpu_eth_init(bis); + if (ret) { + printf(FEC MXC: %s:failed\n, __func__); + return ret; + } + + dev = eth_get_dev_by_name(FEC); + if (!dev) { + printf(FEC MXC: Unable to get FEC device entry\n); + return -EINVAL; + } + + ret = fecmxc_register_mii_postcall(dev, fecmxc_mii_postcall); + if (ret) { + printf(FEC MXC: Unable to register FEC mii postcall\n); + return ret; + } + + return 0; +} + int board_early_init_f(void) { setup_iomux_uart(); + setup_iomux_enet(); return 0; } diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h index a7b363d..124a7a6 100644
[U-Boot] [PATCH V2 1/1] i.mx: i.mx6q: add the initial support for i.mx6q Sabre Lite board
Add the initial support for Freescale i.MX6Q Sabre Lite board Signed-off-by: Dirk Behme dirk.be...@de.bosch.com Signed-off-by: Jason Liu jason@linaro.org --- V2: change the default script to let linaro image boot, and also change the default env to dev 0, which is normal SD slot, not the Micro-SD slot --- MAINTAINERS |1 + board/freescale/mx6qsabrelite/Makefile| 42 ++ board/freescale/mx6qsabrelite/imximage.cfg| 170 + board/freescale/mx6qsabrelite/mx6qsabrelite.c | 150 ++ boards.cfg|1 + include/configs/mx6qsabrelite.h | 162 +++ 6 files changed, 526 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 52d86bd..8a4060f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -569,6 +569,7 @@ Jason Liu r64...@freescale.com mx53evk i.MX53 mx53locoi.MX53 mx6qarm2i.MX6Q + mx6qsabrelite i.MX6Q Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/board/freescale/mx6qsabrelite/Makefile b/board/freescale/mx6qsabrelite/Makefile new file mode 100644 index 000..9b3c493 --- /dev/null +++ b/board/freescale/mx6qsabrelite/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx6qsabrelite.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx6qsabrelite/imximage.cfg b/board/freescale/mx6qsabrelite/imximage.cfg new file mode 100644 index 000..8d3848f --- /dev/null +++ b/board/freescale/mx6qsabrelite/imximage.cfg @@ -0,0 +1,170 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# image version + +IMAGE_VERSION 2 + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) + +BOOT_FROM sd + +# Device Configuration Data (DCD) +# +# Each entry must have the format: +# Addr-type AddressValue +# +# where: +# Addr-type register length (1,2 or 4 bytes) +# Address absolute address of the register +# value value to be stored in the register +DATA 4 0x020e05a8 0x0030 +DATA 4 0x020e05b0 0x0030 +DATA 4 0x020e0524 0x0030 +DATA 4 0x020e051c 0x0030 + +DATA 4 0x020e0518 0x0030 +DATA 4 0x020e050c 0x0030 +DATA 4 0x020e05b8 0x0030 +DATA 4 0x020e05c0 0x0030 + +DATA 4 0x020e05ac 0x00020030 +DATA 4 0x020e05b4 0x00020030 +DATA 4 0x020e0528 0x00020030 +DATA 4 0x020e0520 0x00020030 + +DATA 4 0x020e0514 0x00020030 +DATA 4 0x020e0510 0x00020030 +DATA 4 0x020e05bc 0x00020030 +DATA 4 0x020e05c4 0x00020030 + +DATA 4 0x020e056c 0x00020030 +DATA 4 0x020e0578 0x00020030 +DATA 4 0x020e0588
[U-Boot] [PATCH 0/3] i.mx6q: Add the ethernet function support
This patch add the ethernet function support for i.mx6q/arm2 board. The patch has been tested ok by: Dirk Behme dirk.be...@de.bosch.com on freescale i.mx6qarm2 board. Jason Liu (3): i.mx: i.mx6q: Add the enet clock function fec: add the i.mx6q enet driver support i.mx6q: arm2: Add the enet function support arch/arm/cpu/armv7/mx6/clock.c |5 ++ board/freescale/mx6qarm2/mx6qarm2.c | 90 +++ drivers/net/fec_mxc.c | 10 drivers/net/fec_mxc.h |7 ++- include/configs/mx6qarm2.h | 13 - 5 files changed, 122 insertions(+), 3 deletions(-) -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/3] i.mx: i.mx6q: Add the enet clock function
Cc: Stefano Babic sba...@denx.de Signed-off-by: Jason Liu jason@linaro.org --- arch/arm/cpu/armv7/mx6/clock.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c index b143535..fa3a124 100644 --- a/arch/arm/cpu/armv7/mx6/clock.c +++ b/arch/arm/cpu/armv7/mx6/clock.c @@ -285,6 +285,11 @@ u32 imx_get_uartclk(void) return get_uart_clk(); } +u32 imx_get_fecclk(void) +{ + return decode_pll(PLL_ENET, CONFIG_SYS_MX6_HCLK); +} + unsigned int mxc_get_clock(enum mxc_clock clk) { switch (clk) { -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3] fec: add the i.mx6q enet driver support
Cc: Stefano Babic sba...@denx.de Signed-off-by: Jason Liu jason@linaro.org --- drivers/net/fec_mxc.c | 10 ++ drivers/net/fec_mxc.h |7 ++- 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index b05a4c0..3affda8 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -384,6 +384,14 @@ static int fec_open(struct eth_device *edev) writel(1 2, fec-eth-x_cntrl); fec-rbd_index = 0; +#if defined(CONFIG_MX6Q) + /* Enable ENET HW endian SWAP */ + writel(readl(fec-eth-ecntrl) | FEC_ECNTRL_DBSWAP, + fec-eth-ecntrl); + /* Enable ENET store and forward mode */ + writel(readl(fec-eth-x_wmrk) | FEC_X_WMRK_STRFWD, + fec-eth-x_wmrk); +#endif /* * Enable FEC-Lite controller */ @@ -485,6 +493,8 @@ static int fec_init(struct eth_device *dev, bd_t* bd) rcntrl = PKTSIZE FEC_RCNTRL_MAX_FL_SHIFT; if (fec-xcv_type == SEVENWIRE) rcntrl |= FEC_RCNTRL_FCE; + else if (fec-xcv_type == RGMII) + rcntrl |= FEC_RCNTRL_RGMII; else if (fec-xcv_type == RMII) rcntrl |= FEC_RCNTRL_RMII; else/* MII mode */ diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h index 8b26645..39337bf 100644 --- a/drivers/net/fec_mxc.h +++ b/drivers/net/fec_mxc.h @@ -196,6 +196,7 @@ struct ethernet_regs { #define FEC_RCNTRL_PROM0x0008 #define FEC_RCNTRL_BC_REJ 0x0010 #define FEC_RCNTRL_FCE 0x0020 +#define FEC_RCNTRL_RGMII 0x0040 #define FEC_RCNTRL_RMII0x0100 #define FEC_TCNTRL_GTS 0x0001 @@ -206,6 +207,9 @@ struct ethernet_regs { #define FEC_ECNTRL_RESET 0x0001 /* reset the FEC */ #define FEC_ECNTRL_ETHER_EN0x0002 /* enable the FEC */ +#define FEC_ECNTRL_DBSWAP 0x0100 + +#define FEC_X_WMRK_STRFWD 0x0100 #if defined(CONFIG_MX25) || defined(CONFIG_MX53) /* defines for MIIGSK */ @@ -261,7 +265,8 @@ enum xceiver_type { SEVENWIRE, /* 7-wire */ MII10, /* MII 10Mbps */ MII100, /* MII 100Mbps */ - RMII/* RMII */ + RMII, /* RMII */ + RGMII, /* RGMII */ }; /** -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] i.mx6q: arm2: Add the enet function support
This enable the network function on the i.mx6q armadillo2 board(arm2), thus we can use tftp to load image from network. Cc: Stefano Babic sba...@denx.de Signed-off-by: Jason Liu jason@linaro.org Tested-by: Dirk Behme dirk.be...@de.bosch.com --- board/freescale/mx6qarm2/mx6qarm2.c | 90 +++ include/configs/mx6qarm2.h | 13 - 2 files changed, 101 insertions(+), 2 deletions(-) diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c index 89e0e76..1df063a 100644 --- a/board/freescale/mx6qarm2/mx6qarm2.c +++ b/board/freescale/mx6qarm2/mx6qarm2.c @@ -29,6 +29,8 @@ #include asm/gpio.h #include mmc.h #include fsl_esdhc.h +#include miiphy.h +#include netdev.h DECLARE_GLOBAL_DATA_PTR; @@ -40,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | \ PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) +#define ENET_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |\ + PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_HYS) + int dram_init(void) { gd-ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); @@ -79,11 +85,35 @@ iomux_v3_cfg_t usdhc4_pads[] = { MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), }; +iomux_v3_cfg_t enet_pads[] = { + MX6Q_PAD_KEY_COL1__ENET_MDIO| MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_KEY_COL2__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), +}; + + static void setup_iomux_uart(void) { imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads)); } +static void setup_iomux_enet(void) +{ + imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); +} + #ifdef CONFIG_FSL_ESDHC struct fsl_esdhc_cfg usdhc_cfg[2] = { {USDHC3_BASE_ADDR, 1}, @@ -132,9 +162,69 @@ int board_mmc_init(bd_t *bis) } #endif +#define MII_MMD_ACCESS_CTRL_REG0xd +#define MII_MMD_ACCESS_ADDR_DATA_REG 0xe +#define MII_DBG_PORT_REG 0x1d +#define MII_DBG_PORT2_REG 0x1e + +int fecmxc_mii_postcall(int phy) +{ + unsigned short val; + + /* +* Due to the i.MX6Q Armadillo2 board HW design,there is +* no 125Mhz clock input from SOC. In order to use RGMII, +* We need enable AR8031 ouput a 125MHz clk from CLK_25M +*/ + miiphy_write(FEC, phy, MII_MMD_ACCESS_CTRL_REG, 0x7); + miiphy_write(FEC, phy, MII_MMD_ACCESS_ADDR_DATA_REG, 0x8016); + miiphy_write(FEC, phy, MII_MMD_ACCESS_CTRL_REG, 0x4007); + miiphy_read(FEC, phy, MII_MMD_ACCESS_ADDR_DATA_REG, val); + val = 0xffe3; + val |= 0x18; + miiphy_write(FEC, phy, MII_MMD_ACCESS_ADDR_DATA_REG, val); + + /* For the RGMII phy, we need enable tx clock delay */ + miiphy_write(FEC, phy, 0x1d, 0x5); + miiphy_read(FEC, phy, 0x1e, val); + val |= 0x0100; + miiphy_write(FEC, phy, 0x1e, val); + + miiphy_write(FEC, phy, MII_BMCR, 0xa100); + + return 0; +} + +int board_eth_init(bd_t *bis) +{ + struct eth_device *dev; + int ret; + + ret = cpu_eth_init(bis); + if (ret) { + printf(FEC MXC: %s:failed\n, __func__); + return ret; + } + + dev = eth_get_dev_by_name(FEC); + if (!dev) { + printf(FEC MXC: Unable to get FEC device entry\n); + return -EINVAL; + } + + ret = fecmxc_register_mii_postcall(dev, fecmxc_mii_postcall); + if (ret) { + printf(FEC MXC: Unable to register FEC mii postcall\n); + return ret; + } + + return 0; +} + int board_early_init_f(void) { setup_iomux_uart(); + setup_iomux_enet(); return 0; } diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h index a7b363d..3a30679 100644 --- a/include/configs/mx6qarm2.h +++ b/include/configs/mx6qarm2.h @@ -56,6 +56,17 @@ #define
[U-Boot] [PATCH] i.mx: i.mx6q: add the initial support for i.mx6q Sabre Lite board
From: Dirk Behme dirk.be...@de.bosch.com Add the initial support for Freescale i.MX6Q Sabre Lite board Signed-off-by: Dirk Behme dirk.be...@de.bosch.com Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de --- MAINTAINERS |1 + board/freescale/mx6qsabrelite/Makefile| 42 ++ board/freescale/mx6qsabrelite/imximage.cfg| 170 + board/freescale/mx6qsabrelite/mx6qsabrelite.c | 150 ++ boards.cfg|1 + include/configs/mx6qsabrelite.h | 158 +++ 6 files changed, 522 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 52d86bd..8a4060f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -569,6 +569,7 @@ Jason Liu r64...@freescale.com mx53evk i.MX53 mx53locoi.MX53 mx6qarm2i.MX6Q + mx6qsabrelite i.MX6Q Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/board/freescale/mx6qsabrelite/Makefile b/board/freescale/mx6qsabrelite/Makefile new file mode 100644 index 000..9b3c493 --- /dev/null +++ b/board/freescale/mx6qsabrelite/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx6qsabrelite.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx6qsabrelite/imximage.cfg b/board/freescale/mx6qsabrelite/imximage.cfg new file mode 100644 index 000..8d3848f --- /dev/null +++ b/board/freescale/mx6qsabrelite/imximage.cfg @@ -0,0 +1,170 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# image version + +IMAGE_VERSION 2 + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) + +BOOT_FROM sd + +# Device Configuration Data (DCD) +# +# Each entry must have the format: +# Addr-type AddressValue +# +# where: +# Addr-type register length (1,2 or 4 bytes) +# Address absolute address of the register +# value value to be stored in the register +DATA 4 0x020e05a8 0x0030 +DATA 4 0x020e05b0 0x0030 +DATA 4 0x020e0524 0x0030 +DATA 4 0x020e051c 0x0030 + +DATA 4 0x020e0518 0x0030 +DATA 4 0x020e050c 0x0030 +DATA 4 0x020e05b8 0x0030 +DATA 4 0x020e05c0 0x0030 + +DATA 4 0x020e05ac 0x00020030 +DATA 4 0x020e05b4 0x00020030 +DATA 4 0x020e0528 0x00020030 +DATA 4 0x020e0520 0x00020030 + +DATA 4 0x020e0514 0x00020030 +DATA 4 0x020e0510 0x00020030 +DATA 4 0x020e05bc 0x00020030 +DATA 4 0x020e05c4 0x00020030 + +DATA 4 0x020e056c 0x00020030 +DATA 4 0x020e0578 0x00020030 +DATA 4 0x020e0588 0x00020030 +DATA 4 0x020e0594 0x00020030 + +DATA 4 0x020e057c 0x00020030 +DATA 4 0x020e0590
[U-Boot] [PATCH V3 3/5] i.mx: mxc_gpio: add the i.mx6q support
Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de Acked-by: Stefano Babic sba...@denx.de --- V2: add Stefano's ack --- drivers/gpio/mxc_gpio.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index a7f36b2..908808d 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -40,10 +40,10 @@ static unsigned long gpio_ports[] = { [0] = GPIO1_BASE_ADDR, [1] = GPIO2_BASE_ADDR, [2] = GPIO3_BASE_ADDR, -#if defined(CONFIG_MX51) || defined(CONFIG_MX53) +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6Q) [3] = GPIO4_BASE_ADDR, #endif -#if defined(CONFIG_MX53) +#if defined(CONFIG_MX53) || defined(CONFIG_MX6Q) [4] = GPIO5_BASE_ADDR, [5] = GPIO6_BASE_ADDR, [6] = GPIO7_BASE_ADDR, -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V3 0/5] i.mx: add the initial i.mx6q core/board support
This patch-set add the initial support for freescale i.mx6q support. freescale i.mx6q is a quad core built on arm cortex_a9 complex. The patch-set has been tested ok on freescale i.mx6q Armadillo2 board and also make sure it does not break i.mx5 support The v1 patch-set has also been tested Ok by: Dirk Behme Tested-by: Dirk Behme dirk.be...@de.bosch.com The patch-set is based on Stefano's uart clean up patch: http://patchwork.ozlabs.org/patch/127115/ Jason Liu (5): i.mx: introduce the armv7/imx-common folder i.mx: add the initial support for freescale i.MX6Q processor i.mx: mxc_gpio: add the i.mx6q support i.mx: fsl_esdhc: add the i.mx6q support i.mx: i.mx6q: add the initial support for i.mx6q ARM2 board MAINTAINERS|1 + Makefile |8 + arch/arm/cpu/armv7/imx-common/Makefile | 47 + arch/arm/cpu/armv7/imx-common/cpu.c| 108 ++ arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c |0 arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c | 17 +- arch/arm/cpu/armv7/mx5/Makefile|2 +- arch/arm/cpu/armv7/mx5/soc.c | 77 - arch/arm/cpu/armv7/mx6/Makefile| 48 + arch/arm/cpu/armv7/mx6/clock.c | 366 + arch/arm/cpu/armv7/mx6/iomux-v3.c | 71 + .../cpu/armv7/{mx5/speed.c = mx6/lowlevel_init.S} | 27 +- arch/arm/cpu/armv7/mx6/soc.c | 82 + arch/arm/include/asm/arch-mx6/ccm_regs.h | 892 +++ .../mx5/speed.c = include/asm/arch-mx6/clock.h} | 45 +- .../mx5/speed.c = include/asm/arch-mx6/gpio.h}| 30 +- arch/arm/include/asm/arch-mx6/imx-regs.h | 236 +++ arch/arm/include/asm/arch-mx6/iomux-v3.h | 103 ++ arch/arm/include/asm/arch-mx6/mx6x_pins.h | 1683 .../speed.c = include/asm/arch-mx6/sys_proto.h} | 31 +- board/freescale/mx6qarm2/Makefile | 42 + board/freescale/mx6qarm2/imximage.cfg | 167 ++ board/freescale/mx6qarm2/mx6qarm2.c| 155 ++ boards.cfg |1 + drivers/gpio/mxc_gpio.c|4 +- drivers/mmc/fsl_esdhc.c| 12 +- include/configs/mx6qarm2.h | 162 ++ 27 files changed, 4251 insertions(+), 166 deletions(-) create mode 100644 arch/arm/cpu/armv7/imx-common/Makefile create mode 100644 arch/arm/cpu/armv7/imx-common/cpu.c copy arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c (100%) rename arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c (84%) mode change 100644 = 100755 create mode 100644 arch/arm/cpu/armv7/mx6/Makefile create mode 100644 arch/arm/cpu/armv7/mx6/clock.c create mode 100644 arch/arm/cpu/armv7/mx6/iomux-v3.c copy arch/arm/cpu/armv7/{mx5/speed.c = mx6/lowlevel_init.S} (58%) create mode 100644 arch/arm/cpu/armv7/mx6/soc.c create mode 100644 arch/arm/include/asm/arch-mx6/ccm_regs.h copy arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/clock.h} (59%) copy arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/gpio.h} (64%) create mode 100644 arch/arm/include/asm/arch-mx6/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx6/iomux-v3.h create mode 100644 arch/arm/include/asm/arch-mx6/mx6x_pins.h rename arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/sys_proto.h} (65%) create mode 100644 board/freescale/mx6qarm2/Makefile create mode 100644 board/freescale/mx6qarm2/imximage.cfg create mode 100644 board/freescale/mx6qarm2/mx6qarm2.c create mode 100644 include/configs/mx6qarm2.h -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V3 5/5] i.mx: i.mx6q: add the initial support for i.mx6q ARM2 board
Add the initial support for Freescale i.MX6Q Armadillo2 board Support: MMC boot from slot 0/1, debug UART(UART4), usdhc. There is two MMC slots on the boards: mmc dev 0 - connect USDHC3 - the lower slot on the board, mmc dev 1 - connect USDHC4 - the upper slot on the board, Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de Tested-by: Dirk Behme dirk.be...@de.bosch.com --- v3: based on the uart clean up patch:http://patchwork.ozlabs.org/patch/127115/ add CONFIG_MXC_UART_BASE,remove CONFIG_MX6Q_UART4 in board config file v2:fix sd3 card detection GPIO remove unneeded parentheses such as (IRAM_SIZE) remove clean and distclean targets in Makefile remove CONFIG_MACH_TYPE setup since linux use DT some cleanup/improvement for the config file from Dirk remove imx_iomux_v3_init call since assign the base in iomux-v3.c improve the commit message to add the mmc slot description --- MAINTAINERS |1 + board/freescale/mx6qarm2/Makefile | 42 board/freescale/mx6qarm2/imximage.cfg | 167 + board/freescale/mx6qarm2/mx6qarm2.c | 155 ++ boards.cfg|1 + include/configs/mx6qarm2.h| 162 6 files changed, 528 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index f6f6b72..52d86bd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -568,6 +568,7 @@ Jason Liu r64...@freescale.com mx53evk i.MX53 mx53locoi.MX53 + mx6qarm2i.MX6Q Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/board/freescale/mx6qarm2/Makefile b/board/freescale/mx6qarm2/Makefile new file mode 100644 index 000..79bc315 --- /dev/null +++ b/board/freescale/mx6qarm2/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx6qarm2.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx6qarm2/imximage.cfg b/board/freescale/mx6qarm2/imximage.cfg new file mode 100644 index 000..ffac1b4 --- /dev/null +++ b/board/freescale/mx6qarm2/imximage.cfg @@ -0,0 +1,167 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# image version + +IMAGE_VERSION 2 + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) + +BOOT_FROM sd + +# Device Configuration Data (DCD) +# +# Each entry must have the format: +# Addr-type AddressValue +# +# where: +# Addr-type register length (1,2 or 4 bytes) +# Address absolute address of the register +# value value to be stored in the register +DATA 4 0x020e05a8 0x0030 +DATA 4
[U-Boot] [PATCH V3 1/5] i.mx: introduce the armv7/imx-common folder
In order to support the coming MX6 platform and to reducde the duplicated code, we had better move some common files or functions to the imx-common folder for sharing. This patch does the following: - move speed.c file from armv7/mx5/speed.c to armv7/imx-common/speed.c - move armv7/mx5/timer.c to armv7/imx-common/timer.c, no any new feature added but just fix the checkpatch errors in the old file and remove the CONFIG_SYS_MX5_CLK32 reference in the file - create one new file cpu.c file to store the common function with i.mx5/6 Signed-off-by: Jason Liu jason@linaro.org Cc:Stefano Babic sba...@denx.de Acked-by: Stefano Babic sba...@denx.de --- V2:extend the commit message to reflect all the changes in the patch rename cpu_info.c to cpu.c file under imx-common as Stefano comments --- Makefile |8 ++ arch/arm/cpu/armv7/imx-common/Makefile | 47 ++ arch/arm/cpu/armv7/imx-common/cpu.c| 108 arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c |0 arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c | 17 ++-- arch/arm/cpu/armv7/mx5/Makefile|2 +- arch/arm/cpu/armv7/mx5/soc.c | 77 - 7 files changed, 173 insertions(+), 86 deletions(-) diff --git a/Makefile b/Makefile index d84b350..977da65 100644 --- a/Makefile +++ b/Makefile @@ -293,6 +293,14 @@ LIBS += post/libpost.o ifneq ($(CONFIG_AM335X)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS += $(CPUDIR)/omap-common/libomap-common.o endif + +ifeq ($(SOC),mx5) +LIBS += $(CPUDIR)/imx-common/libimx-common.o +endif +ifeq ($(SOC),mx6) +LIBS += $(CPUDIR)/imx-common/libimx-common.o +endif + ifeq ($(SOC),s5pc1xx) LIBS += $(CPUDIR)/s5p-common/libs5p-common.o endif diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/cpu/armv7/imx-common/Makefile new file mode 100644 index 000..e5ff375 --- /dev/null +++ b/arch/arm/cpu/armv7/imx-common/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)libimx-common.o + +COBJS = timer.o cpu.o speed.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) + +all: $(obj).depend $(LIB) + +$(LIB):$(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/cpu/armv7/imx-common/cpu.c new file mode 100644 index 000..1e30ae5 --- /dev/null +++ b/arch/arm/cpu/armv7/imx-common/cpu.c @@ -0,0 +1,108 @@ +/* + * (C) Copyright 2007 + * Sascha Hauer, Pengutronix + * + * (C) Copyright 2009 Freescale Semiconductor, Inc. + * + * 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 + */ + +#include common.h +#include asm/errno.h +#include asm/io.h +#include asm/arch/imx-regs.h +#include asm/arch/clock.h +#include asm/arch/sys_proto.h + +#ifdef CONFIG_FSL_ESDHC +#include fsl_esdhc.h +#endif + +static char *get_reset_cause(void) +{ + u32 cause; + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + + cause = readl(src_regs-srsr
[U-Boot] [PATCH V3 4/5] i.mx: fsl_esdhc: add the i.mx6q support
The mmc host controller on the i.mx6q is called usdhc which is redesigned based on the freescale esdhc controller. The usdhc controller is almost compatible with esdhc except it adds one mix register to support debug/SD3.0 and move the low bit 0-6 of XFERTYP register to the mix control reg low bit 0-6. Thus on i.mx6q, we have the following compared with the previous soc: (can refer to RM of chapter 56.3.3) i.mx6q: mix control: bit 31 - bit 7: Added for debug/SD3.0 support bit 6 - bit 0: move in the XFERTYP register bit 6-0 on previous soc XFERTYP register: bit 31 - bit 7: the same as before, bit 6 - bit 0: no-use previous soc mix control: no XFERTYP register: bit 31 - bit 0: xfertype information Signed-off-by: Jason Liu jason@linaro.org Cc: Andy Fleming aflem...@gmail.com Cc: Stefano Babic sba...@denx.de Acked-by: Stefano Babic sba...@denx.de --- v3: cc Andy for mmc maintainer v2: extend the commit message by adding mix/xtertype register change remove one #ifdef as Marek suggested change the print of USDHC/ESDHC to SDHC --- drivers/mmc/fsl_esdhc.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index ec953f0..ddd1b4c 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -58,7 +58,8 @@ struct fsl_esdhc { uintautoc12err; uinthostcapblt; uintwml; - charreserved1[8]; + uintmixctrl; + charreserved1[4]; uintfevt; charreserved2[168]; uinthostver; @@ -298,8 +299,13 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) /* Send the command */ esdhc_write32(regs-cmdarg, cmd-cmdarg); +#if defined(CONFIG_FSL_USDHC) + esdhc_write32(regs-mixctrl, + (esdhc_read32(regs-mixctrl) 0xFF80) | (xfertyp 0x7F)); + esdhc_write32(regs-xfertyp, xfertyp 0x); +#else esdhc_write32(regs-xfertyp, xfertyp); - +#endif /* Wait for the command to complete */ while (!(esdhc_read32(regs-irqstat) IRQSTAT_CC)) ; @@ -482,7 +488,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) mmc = malloc(sizeof(struct mmc)); - sprintf(mmc-name, FSL_ESDHC); + sprintf(mmc-name, FSL_SDHC); regs = (struct fsl_esdhc *)cfg-esdhc_base; /* First reset the eSDHC controller */ -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 1/6] i.mx: introduce the armv7/imx-common folder
In order to support the coming MX6 platform and to reducde the duplicated code, we had better move some common files or functions to the imx-common folder for sharing. This patch does the following: - move speed.c file from armv7/mx5/speed.c to armv7/imx-common/speed.c - move armv7/mx5/timer.c to armv7/imx-common/timer.c, no any new feature added but just fix the checkpatch errors in the old file and remove the CONFIG_SYS_MX5_CLK32 reference in the file - create one new file cpu.c file to store the common function with i.mx5/6 Signed-off-by: Jason Liu jason@linaro.org Cc:Stefano Babic sba...@denx.de --- V2:extend the commit message to reflect all the changes in the patch rename cpu_info.c to cpu.c file under imx-common as Stefano comments --- Makefile |7 ++ arch/arm/cpu/armv7/imx-common/Makefile | 47 ++ arch/arm/cpu/armv7/imx-common/cpu.c| 108 arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c |0 arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c | 17 ++-- arch/arm/cpu/armv7/mx5/Makefile|2 +- arch/arm/cpu/armv7/mx5/soc.c | 77 - 7 files changed, 172 insertions(+), 86 deletions(-) diff --git a/Makefile b/Makefile index 294c762..9672a10 100644 --- a/Makefile +++ b/Makefile @@ -300,6 +300,13 @@ ifeq ($(SOC),omap4) LIBS += $(CPUDIR)/omap-common/libomap-common.o endif +ifeq ($(SOC),mx5) +LIBS += $(CPUDIR)/imx-common/libimx-common.o +endif +ifeq ($(SOC),mx6) +LIBS += $(CPUDIR)/imx-common/libimx-common.o +endif + ifeq ($(SOC),s5pc1xx) LIBS += $(CPUDIR)/s5p-common/libs5p-common.o endif diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/cpu/armv7/imx-common/Makefile new file mode 100644 index 000..e5ff375 --- /dev/null +++ b/arch/arm/cpu/armv7/imx-common/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)libimx-common.o + +COBJS = timer.o cpu.o speed.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) + +all: $(obj).depend $(LIB) + +$(LIB):$(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/cpu/armv7/imx-common/cpu.c new file mode 100644 index 000..1e30ae5 --- /dev/null +++ b/arch/arm/cpu/armv7/imx-common/cpu.c @@ -0,0 +1,108 @@ +/* + * (C) Copyright 2007 + * Sascha Hauer, Pengutronix + * + * (C) Copyright 2009 Freescale Semiconductor, Inc. + * + * 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 + */ + +#include common.h +#include asm/errno.h +#include asm/io.h +#include asm/arch/imx-regs.h +#include asm/arch/clock.h +#include asm/arch/sys_proto.h + +#ifdef CONFIG_FSL_ESDHC +#include fsl_esdhc.h +#endif + +static char *get_reset_cause(void) +{ + u32 cause; + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + + cause = readl(src_regs-srsr); + writel(cause, src_regs-srsr); + + switch (cause) { + case 0x1: + return POR
[U-Boot] [PATCH V2 0/6] i.mx: add the initial i.mx6q core/board support
This patch-set add the initial support for freescale i.mx6q support. freescale i.mx6q is a quad core built on arm cortex_a9 complex. The patch-set has been tested ok on freescale i.mx6q Armadillo2 board and also make sure it does not break i.mx5 support The v1 patch-set has also been tested Ok by: Dirk Behme Tested-by: Dirk Behme dirk.be...@de.bosch.com Jason Liu (6): i.mx: introduce the armv7/imx-common folder i.mx: add the initial support for freescale i.MX6Q processor i.mx: mxc_gpio: add the i.mx6q support i.mx: serial_mxc: add the i.mx6q support i.mx: fsl_esdhc: add the i.mx6q support i.mx: i.mx6q: add the initial support for i.mx6q ARM2 board --- v2: see detailed change log in each commit MAINTAINERS|1 + Makefile |7 + arch/arm/cpu/armv7/imx-common/Makefile | 47 + arch/arm/cpu/armv7/imx-common/cpu.c| 108 ++ arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c |0 arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c | 17 +- arch/arm/cpu/armv7/mx5/Makefile|2 +- arch/arm/cpu/armv7/mx5/soc.c | 77 - arch/arm/cpu/armv7/mx6/Makefile| 48 + arch/arm/cpu/armv7/mx6/clock.c | 366 + arch/arm/cpu/armv7/mx6/iomux-v3.c | 71 + .../cpu/armv7/{mx5/speed.c = mx6/lowlevel_init.S} | 27 +- arch/arm/cpu/armv7/mx6/soc.c | 93 ++ arch/arm/include/asm/arch-mx6/ccm_regs.h | 894 +++ .../mx5/speed.c = include/asm/arch-mx6/clock.h} | 45 +- .../mx5/speed.c = include/asm/arch-mx6/gpio.h}| 30 +- arch/arm/include/asm/arch-mx6/imx-regs.h | 234 +++ arch/arm/include/asm/arch-mx6/iomux-v3.h | 103 ++ arch/arm/include/asm/arch-mx6/mx6x_pins.h | 1683 .../speed.c = include/asm/arch-mx6/sys_proto.h} | 31 +- board/freescale/mx6qarm2/Makefile | 42 + board/freescale/mx6qarm2/imximage.cfg | 167 ++ board/freescale/mx6qarm2/mx6qarm2.c| 155 ++ boards.cfg |1 + drivers/gpio/mxc_gpio.c|4 +- drivers/mmc/fsl_esdhc.c| 12 +- drivers/serial/serial_mxc.c| 10 +- include/configs/mx6qarm2.h | 162 ++ 28 files changed, 4268 insertions(+), 169 deletions(-) create mode 100644 arch/arm/cpu/armv7/imx-common/Makefile create mode 100644 arch/arm/cpu/armv7/imx-common/cpu.c copy arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c (100%) rename arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c (84%) mode change 100644 = 100755 create mode 100644 arch/arm/cpu/armv7/mx6/Makefile create mode 100644 arch/arm/cpu/armv7/mx6/clock.c create mode 100644 arch/arm/cpu/armv7/mx6/iomux-v3.c copy arch/arm/cpu/armv7/{mx5/speed.c = mx6/lowlevel_init.S} (58%) create mode 100644 arch/arm/cpu/armv7/mx6/soc.c create mode 100644 arch/arm/include/asm/arch-mx6/ccm_regs.h copy arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/clock.h} (59%) copy arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/gpio.h} (64%) create mode 100644 arch/arm/include/asm/arch-mx6/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx6/iomux-v3.h create mode 100644 arch/arm/include/asm/arch-mx6/mx6x_pins.h rename arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/sys_proto.h} (65%) create mode 100644 board/freescale/mx6qarm2/Makefile create mode 100644 board/freescale/mx6qarm2/imximage.cfg create mode 100644 board/freescale/mx6qarm2/mx6qarm2.c create mode 100644 include/configs/mx6qarm2.h -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 4/6] i.mx: serial_mxc: add the i.mx6q support
Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de --- v2: Cc Stefano --- drivers/serial/serial_mxc.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index dcb4bd1..7d0f288 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -47,14 +47,18 @@ #elif defined(CONFIG_SYS_MX27_UART6) #define UART_PHYS 0x1001c000 #elif defined(CONFIG_SYS_MX35_UART1) || defined(CONFIG_SYS_MX51_UART1) || \ - defined(CONFIG_SYS_MX53_UART1) + defined(CONFIG_SYS_MX53_UART1) || defined(CONFIG_MX6Q_UART1) #define UART_PHYS UART1_BASE_ADDR #elif defined(CONFIG_SYS_MX35_UART2) || defined(CONFIG_SYS_MX51_UART2) || \ - defined(CONFIG_SYS_MX53_UART2) + defined(CONFIG_SYS_MX53_UART2) || defined(CONFIG_MX6Q_UART2) #define UART_PHYS UART2_BASE_ADDR #elif defined(CONFIG_SYS_MX35_UART3) || defined(CONFIG_SYS_MX51_UART3) || \ - defined(CONFIG_SYS_MX53_UART3) + defined(CONFIG_SYS_MX53_UART3) || defined(CONFIG_MX6Q_UART3) #define UART_PHYS UART3_BASE_ADDR +#elif defined(CONFIG_MX6Q_UART4) +#define UART_PHYS UART4_BASE_ADDR +#elif defined(CONFIG_MX6Q_UART5) +#define UART_PHYS UART5_BASE_ADDR #else #error define CONFIG_SYS_MXxx_UARTx to use the MXC UART driver #endif -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 6/6] i.mx: i.mx6q: add the initial support for i.mx6q ARM2 board
Add the initial support for Freescale i.MX6Q Armadillo2 board Support: MMC boot from slot 0/1, debug UART(UART4), usdhc. There is two MMC slots on the boards: mmc dev 0 - connect USDHC3 - the lower slot on the board, mmc dev 1 - connect USDHC4 - the upper slot on the board, Signed-off-by: Jason Liu jason@linaro.org Cc: Stefano Babic sba...@denx.de Tested-by: Dirk Behme dirk.be...@de.bosch.com --- v2:fix sd3 card detection GPIO remove unneeded parentheses such as (IRAM_SIZE) remove clean and distclean targets in Makefile remove CONFIG_MACH_TYPE setup since linux use DT some cleanup/improvement for the config file from Dirk remove imx_iomux_v3_init call since assign the base in iomux-v3.c improve the commit message to add the mmc slot description --- MAINTAINERS |1 + board/freescale/mx6qarm2/Makefile | 42 board/freescale/mx6qarm2/imximage.cfg | 167 + board/freescale/mx6qarm2/mx6qarm2.c | 155 ++ boards.cfg|1 + include/configs/mx6qarm2.h| 162 6 files changed, 528 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 030fe4a..4eab903 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -572,6 +572,7 @@ Jason Liu r64...@freescale.com mx53evk i.MX53 mx53locoi.MX53 + mx6qarm2i.MX6Q Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/board/freescale/mx6qarm2/Makefile b/board/freescale/mx6qarm2/Makefile new file mode 100644 index 000..79bc315 --- /dev/null +++ b/board/freescale/mx6qarm2/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx6qarm2.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx6qarm2/imximage.cfg b/board/freescale/mx6qarm2/imximage.cfg new file mode 100644 index 000..ffac1b4 --- /dev/null +++ b/board/freescale/mx6qarm2/imximage.cfg @@ -0,0 +1,167 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# image version + +IMAGE_VERSION 2 + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) + +BOOT_FROM sd + +# Device Configuration Data (DCD) +# +# Each entry must have the format: +# Addr-type AddressValue +# +# where: +# Addr-type register length (1,2 or 4 bytes) +# Address absolute address of the register +# value value to be stored in the register +DATA 4 0x020e05a8 0x0030 +DATA 4 0x020e05b0 0x0030 +DATA 4 0x020e0524 0x0030 +DATA 4 0x020e051c 0x0030 + +DATA 4 0x020e0518 0x0030 +DATA 4 0x020e050c 0x0030 +DATA 4
[U-Boot] [PATCH V2 5/6] i.mx: fsl_esdhc: add the i.mx6q support
The mmc host controller on the i.mx6q is called usdhc which is redesigned based on the freescale esdhc controller. The usdhc controller is almost compatible with esdhc except it adds one mix register to support debug/SD3.0 and move the low bit 0-6 of XFERTYP register to the mix control reg low bit 0-6. Thus on i.mx6q, we have the following compared with the previous soc: (can refer to RM of chapter 56.3.3) i.mx6q: mix control: bit 31 - bit 7: Added for debug/SD3.0 support bit 6 - bit 0: move in the XFERTYP register bit 6-0 on previous soc XFERTYP register: bit 31 - bit 7: the same as before, bit 6 - bit 0: no-use previous soc mix control: no XFERTYP register: bit 31 - bit 0: xfertype information Signed-off-by: Jason Liu jason@linaro.org CC:Stefano Babic sba...@denx.de Acked-by: Stefano Babic sba...@denx.de --- v2: extend the commit message by adding mix/xtertype register change remove one #ifdef as Marek suggested change the print of USDHC/ESDHC to SDHC --- drivers/mmc/fsl_esdhc.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index ec953f0..ddd1b4c 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -58,7 +58,8 @@ struct fsl_esdhc { uintautoc12err; uinthostcapblt; uintwml; - charreserved1[8]; + uintmixctrl; + charreserved1[4]; uintfevt; charreserved2[168]; uinthostver; @@ -298,8 +299,13 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) /* Send the command */ esdhc_write32(regs-cmdarg, cmd-cmdarg); +#if defined(CONFIG_FSL_USDHC) + esdhc_write32(regs-mixctrl, + (esdhc_read32(regs-mixctrl) 0xFF80) | (xfertyp 0x7F)); + esdhc_write32(regs-xfertyp, xfertyp 0x); +#else esdhc_write32(regs-xfertyp, xfertyp); - +#endif /* Wait for the command to complete */ while (!(esdhc_read32(regs-irqstat) IRQSTAT_CC)) ; @@ -482,7 +488,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) mmc = malloc(sizeof(struct mmc)); - sprintf(mmc-name, FSL_ESDHC); + sprintf(mmc-name, FSL_SDHC); regs = (struct fsl_esdhc *)cfg-esdhc_base; /* First reset the eSDHC controller */ -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/5] mx53loco: Configure the pins as GPIOs prior to using gpio_get_value
2011/11/15 Fabio Estevam feste...@gmail.com: Configure the pins as GPIO prior to using gpio_get_value. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Jason Liu jason@linaro.org --- board/freescale/mx53loco/mx53loco.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index b4c7f33..5e5c38f 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -139,6 +139,9 @@ struct fsl_esdhc_cfg esdhc_cfg[2] = { int board_mmc_getcd(u8 *cd, struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; + + mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1); + mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1); if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) *cd = gpio_get_value(77); /*GPIO3_13*/ -- 1.7.1 ___ 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
Re: [U-Boot] [PATCH 3/5] mx53evk: Configure the pins as GPIOs prior to using gpio_get_value
2011/11/15 Fabio Estevam feste...@gmail.com: Configure the pins as GPIO prior to using gpio_get_value. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Jason Liu jason@linaro.org --- board/freescale/mx53evk/mx53evk.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index 335661f..aa4a2c9 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -212,6 +212,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; + mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1); + mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1); + if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) *cd = gpio_get_value(77); /*GPIO3_13*/ else -- 1.7.1 ___ 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
Re: [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1
2011/11/11 Wolfgang Grandegger w...@denx.de: Signed-off-by: Wolfgang Grandegger w...@denx.de CC: Jason Liu r64...@freescale.com --- board/freescale/mx53loco/mx53loco.c | 10 ++ include/configs/mx53loco.h | 13 + 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index b4c7f33..7bccfa9 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -78,6 +78,16 @@ static void setup_iomux_uart(void) PAD_CTL_ODE_OPENDRAIN_ENABLE); } +#ifdef CONFIG_USB_EHCI_MX5 +void board_ehci_hcd_init(int port) +{ + /* request VBUS power enable pin, GPIO[8}, gpio7 */ ^^ here: :%s/}/] + mxc_request_iomux(MX53_PIN_ATA_DA_2, IOMUX_CONFIG_ALT1); + gpio_direction_output(IMX_GPIO_NR(7, 8), 0); + gpio_set_value(IMX_GPIO_NR(7, 8), 1); +} +#endif + static void setup_iomux_fec(void) { /*FEC_MDIO*/ diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index d699010..9ce43d7 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -72,6 +72,19 @@ #define CONFIG_CMD_MII #define CONFIG_CMD_NET +/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_CMD_FAT +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX5 +#define CONFIG_USB_STORAGE +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_ETHER_SMSC95XX +#define CONFIG_MXC_USB_PORT 1 +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 + /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1 -- 1.7.4.1 ___ 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 0/6] i.mx: add the initial i.mx6q core/board support
This patch-set add the initial support for freescale i.mx6q support. freescale i.mx6q is a quad core built on arm cortex_a9 complex. The patch-set has been tested ok on freescale i.mx6q Armadillo2 board and also make sure it does not break i.mx5 support Jason Liu (6): i.mx: i.mx5: Move some files to imx-common folder i.mx: Add the initial support for freescale i.MX6Q processor i.mx: mxc_gpio: add the i.mx6q support i.mx: serial_mxc: add the i.mx6q support i.mx: fsl_esdhc: add the i.mx6q support i.mx: i.mx6q: Add the initial support for i.mx6q ARM2 board MAINTAINERS|1 + Makefile |7 + arch/arm/cpu/armv7/imx-common/Makefile | 47 + arch/arm/cpu/armv7/imx-common/cpu_info.c | 108 ++ arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c |0 arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c | 17 +- arch/arm/cpu/armv7/mx5/Makefile|2 +- arch/arm/cpu/armv7/mx5/soc.c | 77 - arch/arm/cpu/armv7/mx6/Makefile| 48 + arch/arm/cpu/armv7/mx6/clock.c | 388 + arch/arm/cpu/armv7/mx6/iomux-v3.c | 76 + arch/arm/cpu/armv7/mx6/lowlevel_init.S | 60 + arch/arm/cpu/armv7/{mx5/speed.c = mx6/soc.c} | 40 +- arch/arm/include/asm/arch-mx6/ccm_regs.h | 894 +++ .../mx5/speed.c = include/asm/arch-mx6/clock.h} | 45 +- .../mx5/speed.c = include/asm/arch-mx6/gpio.h}| 28 +- arch/arm/include/asm/arch-mx6/imx-regs.h | 233 +++ arch/arm/include/asm/arch-mx6/iomux-v3.h | 104 ++ arch/arm/include/asm/arch-mx6/mx6x_pins.h | 1683 .../speed.c = include/asm/arch-mx6/sys_proto.h} | 31 +- board/freescale/mx6qarm2/Makefile | 48 + board/freescale/mx6qarm2/imximage.cfg | 167 ++ board/freescale/mx6qarm2/mx6qarm2.c| 163 ++ boards.cfg |1 + drivers/gpio/mxc_gpio.c|4 +- drivers/mmc/fsl_esdhc.c| 14 +- drivers/serial/serial_mxc.c| 10 +- include/configs/mx6qarm2.h | 163 ++ 28 files changed, 4303 insertions(+), 156 deletions(-) create mode 100644 arch/arm/cpu/armv7/imx-common/Makefile create mode 100644 arch/arm/cpu/armv7/imx-common/cpu_info.c copy arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c (100%) rename arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c (84%) mode change 100644 = 100755 create mode 100644 arch/arm/cpu/armv7/mx6/Makefile create mode 100644 arch/arm/cpu/armv7/mx6/clock.c create mode 100644 arch/arm/cpu/armv7/mx6/iomux-v3.c create mode 100644 arch/arm/cpu/armv7/mx6/lowlevel_init.S copy arch/arm/cpu/armv7/{mx5/speed.c = mx6/soc.c} (57%) create mode 100644 arch/arm/include/asm/arch-mx6/ccm_regs.h copy arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/clock.h} (59%) copy arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/gpio.h} (65%) create mode 100644 arch/arm/include/asm/arch-mx6/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx6/iomux-v3.h create mode 100644 arch/arm/include/asm/arch-mx6/mx6x_pins.h rename arch/arm/{cpu/armv7/mx5/speed.c = include/asm/arch-mx6/sys_proto.h} (65%) create mode 100644 board/freescale/mx6qarm2/Makefile create mode 100644 board/freescale/mx6qarm2/imximage.cfg create mode 100644 board/freescale/mx6qarm2/mx6qarm2.c create mode 100644 include/configs/mx6qarm2.h -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/6] i.mx: i.mx5: Move some files to imx-common folder
In order to support the coming MX6 platform and to reducde the duplicated code, we had better move some common files to the imx-common folder for sharing. Signed-off-by: Jason Liu jason@linaro.org --- Makefile |7 ++ arch/arm/cpu/armv7/imx-common/Makefile | 47 ++ arch/arm/cpu/armv7/imx-common/cpu_info.c | 108 arch/arm/cpu/armv7/{mx5 = imx-common}/speed.c |0 arch/arm/cpu/armv7/{mx5 = imx-common}/timer.c | 17 ++-- arch/arm/cpu/armv7/mx5/Makefile|2 +- arch/arm/cpu/armv7/mx5/soc.c | 77 - 7 files changed, 172 insertions(+), 86 deletions(-) diff --git a/Makefile b/Makefile index 294c762..9672a10 100644 --- a/Makefile +++ b/Makefile @@ -300,6 +300,13 @@ ifeq ($(SOC),omap4) LIBS += $(CPUDIR)/omap-common/libomap-common.o endif +ifeq ($(SOC),mx5) +LIBS += $(CPUDIR)/imx-common/libimx-common.o +endif +ifeq ($(SOC),mx6) +LIBS += $(CPUDIR)/imx-common/libimx-common.o +endif + ifeq ($(SOC),s5pc1xx) LIBS += $(CPUDIR)/s5p-common/libs5p-common.o endif diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/cpu/armv7/imx-common/Makefile new file mode 100644 index 000..9fe8f02 --- /dev/null +++ b/arch/arm/cpu/armv7/imx-common/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)libimx-common.o + +COBJS = timer.o cpu_info.o speed.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) + +all: $(obj).depend $(LIB) + +$(LIB):$(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/arm/cpu/armv7/imx-common/cpu_info.c b/arch/arm/cpu/armv7/imx-common/cpu_info.c new file mode 100644 index 000..1e30ae5 --- /dev/null +++ b/arch/arm/cpu/armv7/imx-common/cpu_info.c @@ -0,0 +1,108 @@ +/* + * (C) Copyright 2007 + * Sascha Hauer, Pengutronix + * + * (C) Copyright 2009 Freescale Semiconductor, Inc. + * + * 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 + */ + +#include common.h +#include asm/errno.h +#include asm/io.h +#include asm/arch/imx-regs.h +#include asm/arch/clock.h +#include asm/arch/sys_proto.h + +#ifdef CONFIG_FSL_ESDHC +#include fsl_esdhc.h +#endif + +static char *get_reset_cause(void) +{ + u32 cause; + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + + cause = readl(src_regs-srsr); + writel(cause, src_regs-srsr); + + switch (cause) { + case 0x1: + return POR; + case 0x4: + return CSU; + case 0x8: + return IPP USER; + case 0x00010: + return WDOG; + case 0x00020: + return JTAG HIGH-Z; + case 0x00040: + return JTAG SW; + case 0x1: + return WARM BOOT; + default: + return unknown reset; + } +} + +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) +{ + u32 cpurev; + + cpurev = get_cpu_rev(); + printf(CPU: Freescale
[U-Boot] [PATCH 3/6] i.mx: mxc_gpio: add the i.mx6q support
Signed-off-by: Jason Liu jason@linaro.org --- drivers/gpio/mxc_gpio.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index a7f36b2..908808d 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -40,10 +40,10 @@ static unsigned long gpio_ports[] = { [0] = GPIO1_BASE_ADDR, [1] = GPIO2_BASE_ADDR, [2] = GPIO3_BASE_ADDR, -#if defined(CONFIG_MX51) || defined(CONFIG_MX53) +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6Q) [3] = GPIO4_BASE_ADDR, #endif -#if defined(CONFIG_MX53) +#if defined(CONFIG_MX53) || defined(CONFIG_MX6Q) [4] = GPIO5_BASE_ADDR, [5] = GPIO6_BASE_ADDR, [6] = GPIO7_BASE_ADDR, -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/6] i.mx: serial_mxc: add the i.mx6q support
Signed-off-by: Jason Liu jason@linaro.org --- drivers/serial/serial_mxc.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index dcb4bd1..7d0f288 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -47,14 +47,18 @@ #elif defined(CONFIG_SYS_MX27_UART6) #define UART_PHYS 0x1001c000 #elif defined(CONFIG_SYS_MX35_UART1) || defined(CONFIG_SYS_MX51_UART1) || \ - defined(CONFIG_SYS_MX53_UART1) + defined(CONFIG_SYS_MX53_UART1) || defined(CONFIG_MX6Q_UART1) #define UART_PHYS UART1_BASE_ADDR #elif defined(CONFIG_SYS_MX35_UART2) || defined(CONFIG_SYS_MX51_UART2) || \ - defined(CONFIG_SYS_MX53_UART2) + defined(CONFIG_SYS_MX53_UART2) || defined(CONFIG_MX6Q_UART2) #define UART_PHYS UART2_BASE_ADDR #elif defined(CONFIG_SYS_MX35_UART3) || defined(CONFIG_SYS_MX51_UART3) || \ - defined(CONFIG_SYS_MX53_UART3) + defined(CONFIG_SYS_MX53_UART3) || defined(CONFIG_MX6Q_UART3) #define UART_PHYS UART3_BASE_ADDR +#elif defined(CONFIG_MX6Q_UART4) +#define UART_PHYS UART4_BASE_ADDR +#elif defined(CONFIG_MX6Q_UART5) +#define UART_PHYS UART5_BASE_ADDR #else #error define CONFIG_SYS_MXxx_UARTx to use the MXC UART driver #endif -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/6] i.mx: fsl_esdhc: add the i.mx6q support
The mmc host controller on the i.mx6q is called usdhc which is redesigned based on the freescale esdhc controller. The usdhc controller is almost compatible with esdhc except it adds one misc control register from user using experience. Signed-off-by: Jason Liu jason@linaro.org --- drivers/mmc/fsl_esdhc.c | 14 +- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index ec953f0..cd17ef2 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -58,7 +58,12 @@ struct fsl_esdhc { uintautoc12err; uinthostcapblt; uintwml; - charreserved1[8]; +#if defined(CONFIG_FSL_USDHC) + uintmixctrl; + charreserved1[4]; +#else + charreserved1[8]; +#endif uintfevt; charreserved2[168]; uinthostver; @@ -298,6 +303,9 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) /* Send the command */ esdhc_write32(regs-cmdarg, cmd-cmdarg); +#if defined(CONFIG_FSL_USDHC) + esdhc_write32(regs-mixctrl, xfertyp 0x); +#endif esdhc_write32(regs-xfertyp, xfertyp); /* Wait for the command to complete */ @@ -482,7 +490,11 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) mmc = malloc(sizeof(struct mmc)); +#if defined(CONFIG_FSL_USDHC) + sprintf(mmc-name, FSL_USDHC); +#else sprintf(mmc-name, FSL_ESDHC); +#endif regs = (struct fsl_esdhc *)cfg-esdhc_base; /* First reset the eSDHC controller */ -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/6] i.mx: i.mx6q: Add the initial support for i.mx6q ARM2 board
Add the initial support for Freescale i.MX6Q Armadillo2 board Support: MMC boot from slot 0/1, debug UART(UART4), usdhc. Signed-off-by: Jason Liu jason@linaro.org --- MAINTAINERS |1 + board/freescale/mx6qarm2/Makefile | 48 ++ board/freescale/mx6qarm2/imximage.cfg | 167 + board/freescale/mx6qarm2/mx6qarm2.c | 163 boards.cfg|1 + include/configs/mx6qarm2.h| 163 6 files changed, 543 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 030fe4a..4eab903 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -572,6 +572,7 @@ Jason Liu r64...@freescale.com mx53evk i.MX53 mx53locoi.MX53 + mx6qarm2i.MX6Q Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/board/freescale/mx6qarm2/Makefile b/board/freescale/mx6qarm2/Makefile new file mode 100644 index 000..5ca7ec1 --- /dev/null +++ b/board/freescale/mx6qarm2/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx6qarm2.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx6qarm2/imximage.cfg b/board/freescale/mx6qarm2/imximage.cfg new file mode 100644 index 000..8401264 --- /dev/null +++ b/board/freescale/mx6qarm2/imximage.cfg @@ -0,0 +1,167 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# image version + +IMAGE_VERSION 2 + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) + +BOOT_FROM sd + +# Device Configuration Data (DCD) +# +# Each entry must have the format: +# Addr-type AddressValue +# +# where: +# Addr-type register length (1,2 or 4 bytes) +# Address absolute address of the register +# value value to be stored in the register +DATA 4 0x020e05a8 0x0030 +DATA 4 0x020e05b0 0x0030 +DATA 4 0x020e0524 0x0030 +DATA 4 0x020e051c 0x0030 + +DATA 4 0x020e0518 0x0030 +DATA 4 0x020e050c 0x0030 +DATA 4 0x020e05b8 0x0030 +DATA 4 0x020e05c0 0x0030 + +DATA 4 0x020e05ac 0x00020030 +DATA 4 0x020e05b4 0x00020030 +DATA 4 0x020e0528 0x00020030 +DATA 4 0x020e0520 0x00020030 + +DATA 4 0x020e0514 0x00020030 +DATA 4 0x020e0510 0x00020030 +DATA 4 0x020e05bc 0x00020030 +DATA 4 0x020e05c4 0x00020030 + +DATA 4 0x020e056c 0x00020030 +DATA 4 0x020e0578 0x00020030 +DATA 4 0x020e0588 0x00020030 +DATA 4 0x020e0594 0x00020030 + +DATA 4 0x020e057c 0x00020030 +DATA 4 0x020e0590 0x3000 +DATA 4 0x020e0598 0x3000
Re: [U-Boot] [PATCH] mx31pdk: Enable D and I caches
Fabio, 2011/11/3 Fabio Estevam feste...@gmail.com: Hi Stefano, On Wed, Nov 2, 2011 at 6:41 AM, Stefano Babic sba...@denx.de wrote: Good. To be sure, do you have also tested NAND in u-boot ? I do not expect problems, but... Yes, I confirmed that NAND works with the caches enabled by doing the following tests: 1. Save environment variables in NAND 2. Reprogram U-boot in NAND using run prg_uboot script. I would like to investigate the FEC issue when caches are enabled when I have a chance. Would you have any pointers as to where to start investigating why the FEC driver is buggy when caches are enabled? you can search the tread: [U-Boot] i.MX51: FEC: Cache coherency problem? Jason Liu Thanks, Fabio Estevam ___ 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
Re: [U-Boot] [PATCH] mx53evk: Add RTC support
2011/10/25 Stefano Babic sba...@denx.de: On 10/25/2011 01:44 PM, Fabio Estevam wrote: MX53EVK has an MC13892 PMIC. Add RTC support. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- include/configs/mx53evk.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h index c1941e3..6c4d34f 100644 --- a/include/configs/mx53evk.h +++ b/include/configs/mx53evk.h @@ -63,6 +63,7 @@ #define CONFIG_PMIC_I2C #define CONFIG_PMIC_FSL #define CONFIG_SYS_FSL_PMIC_I2C_ADDR 8 +#define CONFIG_RTC_MC13XXX /* MMC Configs */ #define CONFIG_FSL_ESDHC @@ -88,6 +89,7 @@ #define CONFIG_CMD_DHCP #define CONFIG_CMD_MII #define CONFIG_CMD_NET +#define CONFIG_CMD_DATE /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE Jason is not sent in CC as board maintainer - I have added him now. Thanks Stefano. :) Acked-by: Jason Liu jason@linaro.org BR, Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/6] mx53evk: Remove unneeded '1' from mx53evk.h
2011/10/27 Fabio Estevam fabio.este...@freescale.com: Remove unneeded '1' from mx53evk.h. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - Fix board name in Subject include/configs/mx53evk.h | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h index c1941e3..a5d403f 100644 --- a/include/configs/mx53evk.h +++ b/include/configs/mx53evk.h @@ -33,12 +33,12 @@ #include asm/arch/imx-regs.h -#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ -#define CONFIG_REVISION_TAG 1 -#define CONFIG_SETUP_MEMORY_TAGS 1 -#define CONFIG_INITRD_TAG 1 +#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ +#define CONFIG_REVISION_TAG +#define CONFIG_SETUP_MEMORY_TAGS +#define CONFIG_INITRD_TAG -#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_LIBFDT /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) @@ -51,9 +51,9 @@ #define CONFIG_SYS_MX53_UART1 /* I2C Configs */ -#define CONFIG_CMD_I2C 1 -#define CONFIG_HARD_I2C 1 -#define CONFIG_I2C_MXC 1 +#define CONFIG_CMD_I2C +#define CONFIG_HARD_I2C +#define CONFIG_I2C_MXC #define CONFIG_SYS_I2C_MX53_PORT2 1 #define CONFIG_SYS_I2C_SPEED 10 #define CONFIG_SYS_I2C_SLAVE 0xfe -- 1.7.1 Acked-by: Jason Liu r64...@freescale.com BR, Jason ___ 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
Re: [U-Boot] [PATCH 5/6] mx53loco: Remove unused get_board_rev function
2011/10/27 Fabio Estevam fabio.este...@freescale.com: No board information is passed for MX53LOCO, so remove get_board_rev function. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- board/freescale/mx53loco/mx53loco.c | 5 - include/configs/mx53loco.h | 1 - 2 files changed, 0 insertions(+), 6 deletions(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 156f8b5..b4c7f33 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -38,11 +38,6 @@ DECLARE_GLOBAL_DATA_PTR; -u32 get_board_rev(void) -{ - return get_cpu_rev(); -} - int dram_init(void) { u32 size1, size2; diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index f35bac1..d699010 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -35,7 +35,6 @@ #include asm/arch/imx-regs.h #define CONFIG_CMDLINE_TAG -#define CONFIG_REVISION_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG Acked-by: Jason Liu r64...@freescale.com BR, Jason -- 1.7.1 ___ 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
Re: [U-Boot] [PATCH 2/6] mx53evk: Remove unused get_board_rev function
2011/10/27 Fabio Estevam fabio.este...@freescale.com: No board information is passed for MX53EVK, so remove get_board_rev function. Cc: Jason Liu r64...@freescale.com Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- board/freescale/mx53evk/mx53evk.c | 5 - include/configs/mx53evk.h | 1 - 2 files changed, 0 insertions(+), 6 deletions(-) diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index eab9c5f..335661f 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -39,11 +39,6 @@ DECLARE_GLOBAL_DATA_PTR; -u32 get_board_rev(void) -{ - return get_cpu_rev(); -} - int dram_init(void) { /* dram_init must store complete ramsize in gd-ram_size */ diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h index a5d403f..f9fc149 100644 --- a/include/configs/mx53evk.h +++ b/include/configs/mx53evk.h @@ -34,7 +34,6 @@ #include asm/arch/imx-regs.h #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ -#define CONFIG_REVISION_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG Acked-by: Jason Liu r64...@freescale.com -- 1.7.1 ___ 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] cosmetic: fsl_pmic: cosmetic for the help message
This is cosmetic patch for the help message: Before: pmic dump [numregs] dump registers After: pmic dump [numregs] - dump registers Signed-off-by: Jason Liu jason@linaro.org --- drivers/misc/fsl_pmic.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/misc/fsl_pmic.c b/drivers/misc/fsl_pmic.c index ef80ad9..23255a5 100644 --- a/drivers/misc/fsl_pmic.c +++ b/drivers/misc/fsl_pmic.c @@ -230,6 +230,6 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) U_BOOT_CMD( pmic, CONFIG_SYS_MAXARGS, 1, do_pmic, Freescale PMIC (Atlas), - dump [numregs] dump registers\n + dump [numregs] - dump registers\n pmic write reg value - write register ); -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/4] I2C: mxc_i2c rework
Hi, Stefano, 2011/9/19 Stefano Babic sba...@denx.de: On 09/15/2011 02:09 AM, Marek Vasut wrote: Rewrite the mxc_i2c driver. * This version is much closer to Linux implementation. * Fixes IPG_PERCLK being incorrectly used as clock source * Fixes behaviour of the driver on iMX51 * Clean up coding style a bit ;-) Signed-off-by: Marek Vasut marek.va...@gmail.com --- Hi Marek, you miss to set the version number of your patchset. This can confuse us, as confuses patchwork. Jason, do you have any issue with the last version of this patch (again, without version number, sent by Marek last 15/9) ? I saw Heiko's ACK in a previous version, but I won't push if some boards/SOC will be broken by this patchset. Any comments ? I will give one test on the latest patch set (v4) tomorrow and send out the test result. Sorry for the delay. Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] MX25: Add initial support for MX25PDK
2011/8/30 Fabio Estevam fabio.este...@freescale.com: Add the initial support for MX25PDK booting from SD card via internal boot. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- [...] --- /dev/null +++ b/include/configs/mx25pdk.h @@ -0,0 +1,109 @@ +/* + * (C) Copyright 2011 Freescale Semiconductor, Inc. + * + * 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. + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* High Level Configuration Options */ + +#define CONFIG_ARM926EJS /* arm926ejs CPU core */ +#define CONFIG_MX25 +#define CONFIG_MX25PDK +#define CONFIG_MX25_CLK32 32768 /* OSC32K frequency */ +#define CONFIG_SYS_HZ 1000 +#define CONFIG_SYS_TEXT_BASE 0x8120 + +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ +#define CONFIG_SETUP_MEMORY_TAGS +#define CONFIG_INITRD_TAG + +/* Size of malloc() pool */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) + +/* Physical Memory Map */ + +#define CONFIG_NR_DRAM_BANKS 1 +#define PHYS_SDRAM_1 0x8000 +#define PHYS_SDRAM_1_SIZE (64 * 1024 * 1024) + +#define CONFIG_BOARD_EARLY_INIT_F + +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - \ + GENERATED_GBL_DATA_SIZE) + +/* Memory Test */ +#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1 +#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE) Can we test the full DDR memory size? Jason ___ 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
Re: [U-Boot] [PATCH 12/14] MX5: mx53evk: make use of GPIO framework
2011/8/21 Stefano Babic sba...@denx.de: Signed-off-by: Stefano Babic sba...@denx.de CC: Jason Liu r64...@freescale.com --- board/freescale/mx53evk/mx53evk.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index 88095dc..81857ff 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -33,7 +33,7 @@ #include mmc.h #include fsl_esdhc.h #include fsl_pmic.h -#include mxc_gpio.h +#include asm/gpio.h #include mc13892.h DECLARE_GLOBAL_DATA_PTR; @@ -213,9 +213,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) - *cd = mxc_gpio_get(77); /*GPIO3_13*/ + *cd = gpio_get_value(77); /*GPIO3_13*/ else - *cd = mxc_gpio_get(75); /*GPIO3_11*/ + *cd = gpio_get_value(75); /*GPIO3_11*/ return 0; } Acked-by: Jason Liu jason@linaro.org Tested-by: Jason Liu jason@linaro.org -- 1.7.1 ___ 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
Re: [U-Boot] [PATCH 13/14] MX5: mx53loco: make use of GPIO framework
2011/8/21 Stefano Babic sba...@denx.de: Signed-off-by: Stefano Babic sba...@denx.de CC: Jason Liu r64...@freescale.com --- board/freescale/mx53loco/mx53loco.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 18b388e..ade1006 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -34,7 +34,7 @@ #include i2c.h #include mmc.h #include fsl_esdhc.h -#include mxc_gpio.h +#include asm/gpio.h DECLARE_GLOBAL_DATA_PTR; @@ -146,9 +146,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; if (cfg-esdhc_base == MMC_SDHC1_BASE_ADDR) - *cd = mxc_gpio_get(77); /*GPIO3_13*/ + *cd = gpio_get_value(77); /*GPIO3_13*/ else - *cd = mxc_gpio_get(75); /*GPIO3_11*/ + *cd = gpio_get_value(75); /*GPIO3_11*/ return 0; } Acked-by: Jason Liu jason@linaro.org Tested-by: Jason Liu jason@linaro.org -- 1.7.1 ___ 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
Re: [U-Boot] armv7: integrate cache maintenance support breaks km_kirkwood ethernet
Hi, All, 2011/7/29 Wolfgang Denk w...@denx.de: Dear Aneesh, In message 4e3161ed.5030...@keymile.com Holger Brunck wrote: today I did a rebase of my development branch to current u-boot master. And I saw on our km_kirkwood board that our egiga0 interface isn't working anymore. The CPU is a: SoC: Kirkwood 88F6281_A0 After bisecting the current tree I got: c2dd0d45540397704de9b13287417d21049d34c6 is the first bad commit commit c2dd0d45540397704de9b13287417d21049d34c6 Author: Aneesh V ane...@ti.com Date: Thu Jun 16 23:30:49 2011 + armv7: integrate cache maintenance support And indeed after reverting this commit on current HEAD my board is usable again. The same is true for iMX27 (and probably other boards / SoCs): I verified for both the imx27lite and magnesium boards that above patch breaks Ethernet on these iMX27 boards. Seems we have a bigger problem here... The root cause is that: This commit enable d-cache for all the ARM platform silently, Not just ARMV7. --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -450,6 +450,12 @@ void board_init_r (gd_t *id, ulong dest_addr) gd-flags |= GD_FLG_RELOC; /* tell others: relocation done */ monitor_flash_len = _end_ofs; + /* +* Enable D$: +* I$, if needed, must be already enabled in start.S +*/ + dcache_enable(); + And for such kind of big change, it should broadcast to everyone by ML, otherwise, many people will pay much to checkout what's going on. It did cost me half day to find it out. Jason 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 In English, every word can be verbed. Would that it were so in our programming languages. ___ 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
Re: [U-Boot] [PATCH] mx53: use CONFIG_SYS_L2CACHE_OFF in config file
Hi, stefano, 2011/7/28 Stefano Babic sba...@denx.de: On 07/28/2011 07:56 AM, Jason Liu wrote: Hi, Stefano, Hi Jason, It's used before, if you checkout tag: v2011.06 #ifndef CONFIG_L2_OFF /* turn off L2 cache */ l2_cache_disable(); /* invalidate L2 cache also */ invalidate_dcache(get_device_type()); #endif i = 0; /* mem barrier to sync up things */ asm(mcr p15, 0, %0, c7, c10, 4: :r(i)); #ifndef CONFIG_L2_OFF l2_cache_enable(); #endif However, as far as I can understand, L2 cache is disabled until explicitely enabled. Look at the meaning from the name X_OFF, if we define it, it tells people that we want to disable it explicitly. If not define it, it underlying tells that we want to enable it, right? So, if we remove this define L2_OFF from board config file, it may cause confuse since we don't want to enable it now. I still think we need explicitly disable L2 cache first I am still checking this point. My concern is to understand if in the current code we need to do something or not. If there is no code to enable L2 cache (I have not found), there should be no need to disable it. After a reset, L2 cache is disabled, am I right ? Why do you think we have to explicitely disable it ? Am I missing something ? Currently, MX5 will disable L2 after reset. some points as above. . If it only omap related, I don't think we need CONFIG_SYS_L2CACHE_OFF for the global u-boot. If you grep the CONFIG_SYS_L2CACHE_OFF under include/configs, you will see a lot of define other than omap platform. Nevertheless we have to decide if we need it for the MX5. If we manage enable/disable L2 Cache for the MX5, we need it, else not. As I can see in the actual code, we do not manage L2 Cache. Yes, currently, we don't manage L2. But, I don't know whether the common code will be changed in the future, if we don't disable L2 explicitly, it will enable L2 by default just like d-cache. It's due to it enable dcache by default if not define CONFIG_SYS_DCACHE_OFF explicitly. mxc_fec driver need be fixed or re-write to consider cache safe. I agree to disable d-cache first. Do I need submit patch to disable D-CACHE first? let's see if we agree on the following points: - CONFIG_L2_OFF is obsolete, as you pointed out, and must be removed - CONFIG_SYS_L2CACHE_OFF is needed for MX5 if we have code to enable / disable it. Let me know if you agree that L2 cache is disabled after a reset. Then we do not need this define until we explicitely enable it as default, as now for D cache. - because of D Cache issues in the driver, it is better to disable D Cache for MX5 processors. I think, if we agree on these point, we can manage the changes in a single patch (changes are made on the same files, that is the configuration file for the boards), and it is enough to add a useful comment to explain what we do. OK, after get agreement, I will do it soon with single patch. And another issue for imx51 is that mmc command does not work correctly sometimes such as saveenv. Do you notice that? I admit I have not tested recently and I have not noted this issue. Last time was after some changes in MMC code. I am sure we get the same issues for D Cache as for the FEC. In fact, for powerpc the fsl_esdhc.c enables cache snooping and does not need to invalidate buffers. We have no counterpart for MX5. Yes, correct. Jason 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] mx53: use CONFIG_SYS_L2CACHE_OFF in config file
Hi, Stefano, 2011/7/26 Jason Hui jason@linaro.org: Hi, Stefano, On Tue, Jul 26, 2011 at 5:21 PM, Stefano Babic sba...@denx.de wrote: On 07/26/2011 10:25 AM, Jason Liu wrote: CONFIG_L2_OFF is obsolete after the following commit: e47f2db5371047eb9bcd115fee084e6a8a92a239 armv7: rename cache related CONFIG flags Replace the cache related CONFIG flags with more meaningful names. Following are the changes: CONFIG_L2_OFF - CONFIG_SYS_L2CACHE_OFF But the above commit does not clean up all the mx53 board config file. This patch does it by using CONFIG_SYS_L2CACHE_OFF instead of _L2_OFF Hi Jason, I agree that CONFIG_L2_OFF is obsolete and must be removed. However, I do not see any application of CONFIG_SYS_L2CACHE_OFF. If I grep into u-boot code, this config is not used at all for i.MX. Indeed, I can find application for OMAP boards: arch/arm/cpu/armv7/omap3/board.c:#ifndef CONFIG_SYS_L2CACHE_OFF arch/arm/cpu/armv7/omap3/board.c:#ifndef CONFIG_SYS_L2CACHE_OFF arch/arm/cpu/armv7/s5pc1xx/cache.S:#ifndef CONFIG_SYS_L2CACHE_OFF arch/arm/cpu/armv7/omap4/board.c:#ifndef CONFIG_SYS_L2CACHE_OFF So this setup is usefulness, I think. It's used before, if you checkout tag: v2011.06 #ifndef CONFIG_L2_OFF /* turn off L2 cache */ l2_cache_disable(); /* invalidate L2 cache also */ invalidate_dcache(get_device_type()); #endif i = 0; /* mem barrier to sync up things */ asm(mcr p15, 0, %0, c7, c10, 4: :r(i)); #ifndef CONFIG_L2_OFF l2_cache_enable(); #endif I still think we need explicitly disable L2 cache first. If it only omap related, I don't think we need CONFIG_SYS_L2CACHE_OFF for the global u-boot. If you grep the CONFIG_SYS_L2CACHE_OFF under include/configs, you will see a lot of define other than omap platform. By the way (and I know it is not the same topic), do you mean maybe CONFIG_SYS_DCACHE_OFF ? Have you read the thread related to cache problems on MX51 ? Maybe we have to disable D_CACHE until we find a fix for the drivers. What do you mean ? Yes, the fec is not working after commit: c2dd0d45540397704de9b13287417d21049d34c6 armv7: integrate cache maintenance support It's due to it enable dcache by default if not define CONFIG_SYS_DCACHE_OFF explicitly. mxc_fec driver need be fixed or re-write to consider cache safe. I agree to disable d-cache first. Do I need submit patch to disable D-CACHE first? And another issue for imx51 is that mmc command does not work correctly sometimes such as saveenv. Do you notice that? Jason Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx53: use CONFIG_SYS_L2CACHE_OFF in config file
CONFIG_L2_OFF is obsolete after the following commit: e47f2db5371047eb9bcd115fee084e6a8a92a239 armv7: rename cache related CONFIG flags Replace the cache related CONFIG flags with more meaningful names. Following are the changes: CONFIG_L2_OFF- CONFIG_SYS_L2CACHE_OFF But the above commit does not clean up all the mx53 board config file. This patch does it by using CONFIG_SYS_L2CACHE_OFF instead of _L2_OFF Signed-off-by: Jason Liu jason@linaro.org Cc:Stefano Babic sba...@denx.de --- include/configs/mx53ard.h |2 +- include/configs/mx53loco.h |2 +- include/configs/mx53smd.h |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h index c872510..0e323e6 100644 --- a/include/configs/mx53ard.h +++ b/include/configs/mx53ard.h @@ -29,7 +29,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_L2_OFF +#define CONFIG_SYS_L2CACHE_OFF #include asm/arch/imx-regs.h diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 544e3fb..bc1b401 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -30,7 +30,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_L2_OFF +#define CONFIG_SYS_L2CACHE_OFF #include asm/arch/imx-regs.h diff --git a/include/configs/mx53smd.h b/include/configs/mx53smd.h index 65d5e05..194047b 100644 --- a/include/configs/mx53smd.h +++ b/include/configs/mx53smd.h @@ -29,7 +29,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_L2_OFF +#define CONFIG_SYS_L2CACHE_OFF #include asm/arch/imx-regs.h -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx53: use CONFIG_SYS_L2CACHE_OFF in config file
CONFIG_L2_OFF is obsolete after the following commit: e47f2db5371047eb9bcd115fee084e6a8a92a239 armv7: rename cache related CONFIG flags Replace the cache related CONFIG flags with more meaningful names. Following are the changes: CONFIG_L2_OFF- CONFIG_SYS_L2CACHE_OFF But the above commit does not clean up all the mx53 board config file. This patch does it by using CONFIG_SYS_L2CACHE_OFF instead of _L2_OFF Signed-off-by: Jason Liu jason@linaro.org Cc:Stefano Babic sba...@denx.de --- include/configs/mx53ard.h |2 +- include/configs/mx53loco.h |2 +- include/configs/mx53smd.h |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h index c872510..0e323e6 100644 --- a/include/configs/mx53ard.h +++ b/include/configs/mx53ard.h @@ -29,7 +29,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_L2_OFF +#define CONFIG_SYS_L2CACHE_OFF #include asm/arch/imx-regs.h diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 544e3fb..bc1b401 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -30,7 +30,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_L2_OFF +#define CONFIG_SYS_L2CACHE_OFF #include asm/arch/imx-regs.h diff --git a/include/configs/mx53smd.h b/include/configs/mx53smd.h index 65d5e05..194047b 100644 --- a/include/configs/mx53smd.h +++ b/include/configs/mx53smd.h @@ -29,7 +29,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_L2_OFF +#define CONFIG_SYS_L2CACHE_OFF #include asm/arch/imx-regs.h -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx53: use CONFIG_SYS_L2CACHE_OFF in config file
Hi, Wolfgang, 2011/7/26 Wolfgang Denk w...@denx.de: Dear Jason Liu, In message 1311668750-5471-1-git-send-email-jason@linaro.org you wrote: CONFIG_L2_OFF is obsolete after the following commit: e47f2db5371047eb9bcd115fee084e6a8a92a239 armv7: rename cache related CONFIG flags Replace the cache related CONFIG flags with more meaningful names. Following are the changes: CONFIG_L2_OFF - CONFIG_SYS_L2CACHE_OFF But the above commit does not clean up all the mx53 board config file. This patch does it by using CONFIG_SYS_L2CACHE_OFF instead of _L2_OFF Signed-off-by: Jason Liu jason@linaro.org Cc:Stefano Babic sba...@denx.de why are you posting a second version of this patch just a few minutes after the first one, and witrhout any indication ifd there are any differences between the two versions, and what these differences might be? Please STOP doing this! It's my fault to send out the second email when I thought the previous email was not show up in mail-list. will take care to avoid it later. Sorry for the noise. Jason 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 The faster I go, the behinder I get. -- Lewis Carroll ___ 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
Re: [U-Boot] [PATCH V7 1/3] MX5: clock: Add clock config interface
Hi, Stefano, 2011/5/16 Stefano Babic sba...@denx.de: On 05/11/2011 10:03 AM, Jason Liu wrote: diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c index 0b04a88..04d9f71 100644 --- a/arch/arm/cpu/armv7/mx5/clock.c +++ b/arch/arm/cpu/armv7/mx5/clock.c @@ -24,6 +24,7 @@ */ +#define AHB_CLK_ROOT 1 +#define SZ_DEC_1M 100 Is this define used only to get the value in Mhz from the PLL clock ? If it is the case, the name is quite confusing, as it refers to a size. If it is not the case, please explain. I will get rid of the definition for AHB_CLK_ROOT and it's no need to define here since it only use once in the code. I will rename the SZ_DEC_1M or get rid of it also. +#define PLL_PD_MAX 16 /* Actual pd+1 */ +#define PLL_MFI_MAX 15 +#define PLL_MFI_MIN 5 +#define ARM_DIV_MAX 8 +#define IPG_DIV_MAX 4 +#define AHB_DIV_MAX 8 +#define EMI_DIV_MAX 8 +#define NFC_DIV_MAX 8 Definitions for clock registers are in the crm_regs.h file. These are the maximum values for some fields in the registers. Should they not be put inside the crm_regs.h ? Yes, make sense, I will put it to crm_regs.h file. + +struct fixed_pll_mfd { + u32 ref_clk_hz; + u32 mfd; +}; + +const struct fixed_pll_mfd fixed_mfd[] = { + {CONFIG_SYS_MX5_HCLK, 24 * 16}, +}; Not understood the need of an array (I have not said it is wrong, simply I have not understood !). You use in the code (this is another issue) ref as parameter for your functions for the reference clock, but is seems to me that the only possible value is CONFIG_SYS_MX5_HCLK. I use array here just for the case we will have another element in the array (currently we only have one) in the future. Currently, we use 24MHz as ref. Are there other use case for this array, that makes sense to define and maybe to extend it ? Just in case the PLL ref clock is not from 24MHZ. Can you add a reference to the manual explaining where these values are coming from ? Do you mean the value 24 * 16? If yes, it's just for the simpler calculation. + +struct pll_param { + u32 pd; + u32 mfi; + u32 mfn; + u32 mfd; +}; + +#define PLL_FREQ_MAX(ref_clk) (4 * (ref_clk) * PLL_MFI_MAX) +#define PLL_FREQ_MIN(ref_clk) \ + ((2 * (ref_clk) * (PLL_MFI_MIN - 1)) / PLL_PD_MAX) I understand what it is done here, but only after I have finally found where it is described in the manual. Can you add useful comments here and reference to the manual, too ? Such as describing these values are for the registers DP_OP, DP_MFN and DP-MFD, and a reference to the formula (Eqn. 22-1) helps to understand it. OK, I will add the comments here. +#define MAX_DDR_CLK 42000 +#define NFC_CLK_MAX 3400 Where do these values come from ? I understand they are computed values, depending on pll clock. It seems to me (at least for DDR clock) they are absolute maximum rates, but it could be that MAX_DDR_CLK could be set to a lower value depending on the PLL value. Is it correct ? In other words : should be possible to set a PLL (you provide an API for changing it) to a lower value, and then even the defines you set here do not correspond to the real maximum value ? Yes, this is the absolute maximum rate. When you clk_api to config clock, it should not exceed the max value, for example, if (emi_clk MAX_DDR_CLK) { printf(DDR clock should be less than %d MHz, assuming max value \n, ... + /* * The API of get mxc clockes. */ @@ -245,10 +369,12 @@ unsigned int mxc_get_clock(enum mxc_clock clk) case MXC_UART_CLK: return get_uart_clk(); case MXC_CSPI_CLK: - return imx_get_cspiclk(); + return get_cspi_clk(); case MXC_FEC_CLK: return decode_pll(mxc_plls[PLL1_CLOCK], CONFIG_SYS_MX5_HCLK); + case MXC_DDR_CLK: + return get_ddr_clk(); You extended the enum for the clocks, as I see also MXC_NFC_CLK. You should add the MXC_NFC_CLK case, too. OK, I will add it. Is it worth to export the other getter functions, too (get_axi_a/b_clk, get_ahb_clk) ? Yes, I think it's valuable to export it and print it, thus user can know clearly what the axi_a/b and ahb clk rate are. /* + * Clock config code start here + */ + +/* precondition: m0 and n0. Let g=gcd(m,n). */ +static int gcd(int m, int n) +{ + int t; + while (m 0) { + if (n m) { + t = m; + m = n; + n = t; + } /* swap */ + m -= n; + } + return n; +} This function has nothing to do with MX5 code. This is a general function, and should be add to lib/. I think you have to remove it from here and put it in a separate patch. I don't think it should be put to lib since only
Re: [U-Boot] [PATCH 1/1] MX5: clock: Add clock config interface
Hi, Stefano, 2011/4/13 Jason Liu jason@linaro.org: Add clock config interface support, so that we can configure CPU or DDR clock in the later init Signed-off-by: Jason Liu jason@linaro.org --- arch/arm/cpu/armv7/mx5/clock.c | 551 +- arch/arm/include/asm/arch-mx5/clock.h | 4 + arch/arm/include/asm/arch-mx5/crm_regs.h | 6 + arch/arm/include/asm/arch-mx5/imx-regs.h | 1 + 4 files changed, 559 insertions(+), 3 deletions(-) The clock code has been submitted to mail-list for more than one month, any comments for it? Since you are the imx custodian, you need quick review the patch related to imx, right? Jason ___ 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
Re: [U-Boot] [PATCH 1/1] MX5: clock: Add clock config interface
Hi, Stefano, 2011/5/16 Stefano Babic sba...@denx.de: On 05/16/2011 08:04 AM, Jason Liu wrote: Hi, Stefano, Hi Jason, The clock code has been submitted to mail-list for more than one month, any comments for it? Since you are the imx custodian, you need quick review the patch related to imx, right? Because the clock patch was part of a patchset where I have already sent comments to you asking for changing (due to dialog pmic), and the patchset is not merged as it is in mainline, the patch you mentioned is not very urgent, because it adds functions not used anymore in code. Of course, a review is needed and I have already asked to you to give me more time a couple of days ago. I think the normal process should be if you have comments, you need give it as early as possible. Anyway, I will send today my comments on this patch. Thanks, Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] MX53: Remove CONFIG_SYS_BOOTMAPSZ from mx53 config files.
Hi, Stefano, 2011/5/16 Stefano Babic sba...@denx.de: On 05/16/2011 12:58 AM, Fabio Estevam wrote: commit ed59e58 (Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ) made the definition of CONFIG_SYS_BOOTMAPSZ unnecessary. Signed-off-by: Fabio Estevam fabio.este...@freescale.com #define CONFIG_OF_LIBFDT -#define CONFIG_SYS_BOOTMAPSZ 0x80 We have already discussed about it, I think I can safely apply it as fix. When I did mx53loco board and DT support for linaro, grant's patch is not there. But now, we can remove it. Acked-by: Jason Liu jason@linaro.org for mx53loco part. Jason 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 v2 3/3] MX53: Add initial support for MX53ARD board
Hi, Fabio, 2011/5/17 Fabio Estevam fabio.este...@freescale.com: Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - Use io accessors to access weim and iomuxc - Initialize the 2 esdhc controllers - Configure the 2 banks of DDR memory - Fix typo on machine_id - Remove CONFIG_SYS_BOOTMAPSZ from config file MAINTAINERS | 1 + board/freescale/mx53ard/Makefile | 48 + board/freescale/mx53ard/imximage.cfg | 96 +++ board/freescale/mx53ard/mx53ard.c | 314 ++ boards.cfg | 1 + include/configs/mx53ard.h | 193 + 6 files changed, 653 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mx53ard/Makefile create mode 100644 board/freescale/mx53ard/imximage.cfg create mode 100644 board/freescale/mx53ard/mx53ard.c create mode 100644 include/configs/mx53ard.h We have two version of ARD board, one is DDR3 board, Had better specify which ARD board this patch support? Jason Liu ___ 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
Re: [U-Boot] [PATCH v2 2/3] MX5: Add iomux structure
Hi, Fabio, 2011/5/17 Fabio Estevam fabio.este...@freescale.com: Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - iomuxc was accessed directly in v1, so create a iomux struct so that we can use io accessors arch/arm/include/asm/arch-mx5/imx-regs.h | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h index d80e0c0..eb690ec 100644 --- a/arch/arm/include/asm/arch-mx5/imx-regs.h +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h @@ -273,6 +273,17 @@ struct weim { u32 ear; }; +struct iomuxc { + u32 gpr0; + u32 gpr1; + u32 gpr2; + u32 omux0; + u32 omux1; + u32 omux2; + u32 omux3; + u32 omux4; +}; I think iomux register does not limited to the above registers and you defined some unused register such as IOMUXC_OBSERVE_MUX_0, if you only use gpr, you can just define iomuxc_gpr etc. And what's more, mx51 and mx53 has different layout, on i.mx51, the layout is: IOMUXC_GPR0, IOMUXC_GPR1, IOMUXC_OBSERVE_MUX_0, IOMUXC_OBSERVE_MUX_1, IOMUXC_OBSERVE_MUX_2, IOMUXC_OBSERVE_MUX_3, so, you can't simply put it to the common head file for all the i.mx5 soc. + /* GPIO Registers */ struct gpio_regs { u32 gpio_dr; -- 1.6.0.4 ___ 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
Re: [U-Boot] [PATCH v2 1/3] MX5: Make the weim structure complete
Hi, Fabio, 2011/5/17 Fabio Estevam fabio.este...@freescale.com: Make the weim register set complete for MX51/MX53. While at it also add the weim chip select 1 address definition. From the code, you just add the cs for mx53 not for mx51, so, Had better specify you add the cs1 address definition for mx53, otherwise, it will make confusion. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - Make the weim struct complete arch/arm/include/asm/arch-mx5/imx-regs.h | 46 ++ 1 files changed, 40 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h index a1849f8..d80e0c0 100644 --- a/arch/arm/include/asm/arch-mx5/imx-regs.h +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h @@ -41,6 +41,7 @@ #define CSD1_BASE_ADDR 0xB000 #define NFC_BASE_ADDR_AXI 0xF7FF #define IRAM_BASE_ADDR 0xF800 +#define CS1_BASE_ADDR 0xF400 #else #error CPU_TYPE not defined #endif @@ -231,12 +232,45 @@ struct clkctl { Jason Liu -- 1.6.0.4 ___ 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
Re: [U-Boot] [PATCH V2] MX31: Make get_reset_cause() static
Hi, Stefano, 2011/5/16 Stefano Babic sba...@denx.de: Signed-off-by: Fabio Estevam fabio.este...@freescale.com Signed-off-by: Stefano Babic sba...@denx.de --- Changes since V1: - as get_cpu_rev is exported, only get_reset_cause is set to static. arch/arm/cpu/arm1136/mx31/generic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c index fccd2cd..fb01013 100644 --- a/arch/arm/cpu/arm1136/mx31/generic.c +++ b/arch/arm/cpu/arm1136/mx31/generic.c @@ -133,7 +133,7 @@ u32 get_cpu_rev(void) return srev | 0x8000; } -char *get_reset_cause(void) +static char *get_reset_cause(void) { /* read RCSR register from CCM module */ struct clock_control_regs *ccm = -- But looking at the code bellow, beside we need make the function static, do we need to remove the break after the return statement? Otherwise, some complier may warn un-reachable code, IMHO. char *get_reset_cause(void) { /* read RCSR register from CCM module */ struct clock_control_regs *ccm = (struct clock_control_regs *)CCM_BASE; u32 cause = readl(ccm-rcsr) 0x07; switch (cause) { case 0x: return POR; break; case 0x0001: return RST; break; case 0x0002: return WDOG; break; case 0x0006: return JTAG; break; default: return unknown reset; } } Jason Liu 1.7.1 ___ 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
Re: [U-Boot] [PATCH 2/2] MX53: Add initial support for MX53ARD board
Hi, Fabio, [...] +static void setup_iomux_uart(void) +{ + /* UART1 RXD */ + mxc_request_iomux(MX53_PIN_ATA_DMACK, IOMUX_CONFIG_ALT3); + mxc_iomux_set_pad(MX53_PIN_ATA_DMACK, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU | + PAD_CTL_ODE_OPENDRAIN_ENABLE); + mxc_iomux_set_input(MX53_UART1_IPP_UART_RXD_MUX_SELECT_INPUT, 0x3); + + /* UART1 TXD */ + mxc_request_iomux(MX53_PIN_ATA_DIOW, IOMUX_CONFIG_ALT3); + mxc_iomux_set_pad(MX53_PIN_ATA_DIOW, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU | + PAD_CTL_ODE_OPENDRAIN_ENABLE); +} + +#ifdef CONFIG_FSL_ESDHC +struct fsl_esdhc_cfg esdhc_cfg[1] = { + {MMC_SDHC1_BASE_ADDR, 1}, +}; Why only support one mmc slot? + +int board_mmc_getcd(u8 *cd, struct mmc *mmc) +{ + *cd = mxc_gpio_get(1); /*GPIO1*/ + + return 0; +} Dito, here /*GPIO1*/ should be /*GPIO0_1*/ ? + +int board_mmc_init(bd_t *bis) +{ + u32 index; + s32 status = 0; + + for (index = 0; index CONFIG_SYS_FSL_ESDHC_NUM; index++) { + switch (index) { + case 0: + mxc_request_iomux(MX53_PIN_SD1_CMD, IOMUX_CONFIG_ALT0); + mxc_request_iomux(MX53_PIN_SD1_CLK, IOMUX_CONFIG_ALT0); + mxc_request_iomux(MX53_PIN_SD1_DATA0, + IOMUX_CONFIG_ALT0); + mxc_request_iomux(MX53_PIN_SD1_DATA1, + IOMUX_CONFIG_ALT0); + mxc_request_iomux(MX53_PIN_SD1_DATA2, + IOMUX_CONFIG_ALT0); + mxc_request_iomux(MX53_PIN_SD1_DATA3, + IOMUX_CONFIG_ALT0); + mxc_request_iomux(MX53_PIN_EIM_DA13, + IOMUX_CONFIG_ALT1); + + mxc_iomux_set_pad(MX53_PIN_SD1_CMD, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU); + mxc_iomux_set_pad(MX53_PIN_SD1_CLK, + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU | + PAD_CTL_DRV_HIGH); + mxc_iomux_set_pad(MX53_PIN_SD1_DATA0, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU); + mxc_iomux_set_pad(MX53_PIN_SD1_DATA1, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU); + mxc_iomux_set_pad(MX53_PIN_SD1_DATA2, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU); + mxc_iomux_set_pad(MX53_PIN_SD1_DATA3, + PAD_CTL_HYS_ENABLE | PAD_CTL_DRV_HIGH | + PAD_CTL_PUE_PULL | PAD_CTL_PKE_ENABLE | + PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU); + break; + + default: + printf(Warning: you configured more ESDHC controller + (%d) as supported by the board(1)\n, + CONFIG_SYS_FSL_ESDHC_NUM); + return status; Here is wrong, the board can support up to 2 esdhc controller. + } + status |= fsl_esdhc_initialize(bis, esdhc_cfg[index]); + } + + return status; +} +#endif + [..] +void weim_cs1_settings() +{ + unsigned int reg; + + writel(0x20001, (WEIM_BASE_ADDR + 0x18)); + writel(0x0, (WEIM_BASE_ADDR + 0x1C)); + writel(0x16000202, (WEIM_BASE_ADDR + 0x20)); + writel(0x0002, (WEIM_BASE_ADDR + 0x24)); + writel(0x16002082, (WEIM_BASE_ADDR + 0x28)); + writel(0x, (WEIM_BASE_ADDR + 0x2C)); + writel(0x, (WEIM_BASE_ADDR + 0x90)); Can we use struct access here? + + /*
Re: [U-Boot] [PATCH V2 1/1] mx5: board: code clean up for checkboard code
Hi,Stefano, 2011/5/11 Jason Liu liu.h.ja...@gmail.com: Hi, Stefano, 2011/4/22 Jason Liu jason@linaro.org: The boot cause code has been factor out to soc common code,we need drop the part from the board support code This patch also remove the redundant cpu version print Signed-off-by: Jason Liu jason@linaro.org --- changes since v1 -include more clean up by remove the redundant cpu version print --- board/efikamx/efikamx.c | 42 + board/freescale/mx51evk/mx51evk.c | 36 +-- board/freescale/mx53evk/mx53evk.c | 21 +- board/ttcontrol/vision2/vision2.c | 42 + 4 files changed, 4 insertions(+), 137 deletions(-) Ping, any comments about this patch? Any comments, if not, please pull it, thanks. Jason ___ 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
Re: [U-Boot] [PATCH V7 2/3] PMIC: Add dialog pmic support
Hi, Stefano, 2011/5/13 Stefano Babic sba...@denx.de: On 05/13/2011 05:08 AM, Jason Liu wrote: Hi, Stefano, Hi Jason, [...] And BTW, do you have any comments about the 1/3 clock patch? If you have, please tell it as early as possible and I don't want to let the patch version goes up very bigger and the time endless. The patch adds several functions that are strictly related to the processor and I am checking with the reference manuals to understand them. I need more time for it. If that, can we consider that I just add the basic mx53loco support: which exclude: Dialog PMIC support, which is just useful to increase the CPU to 1GHZ, by default voltage, CPU can only run up to 800MHZ, clock code(patch 1/3) , which is just useful to increase DDR run up to 400Mhz, by default it's 333Mhz. I just don't want to break the basic mx53loco board support to mainline for so-long time. Please advise, thanks, Jason 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 V7 3/3] MX53: support for freescale MX53LOCO board
Hi, Stefano, 2011/5/11 Stefano Babic sba...@denx.de: On 05/11/2011 10:03 AM, Jason Liu wrote: This patch add initial support for freescale MX53LOCO board. Network(FEC),SD/MMC,UART have been supported by this patch The patch also config CPU:1GHZ,DDR:400MHZ for better peformance Signed-off-by: Jason Liu jason@linaro.org Hi Jason, ... u32 get_cpu_rev(void); #define is_soc_rev(rev) ((get_cpu_rev() 0xFF) - rev) void sdelay(unsigned long); +void pmic_reg_write(u32 reg, u32 value); +u32 pmic_reg_read(u32 reg); The pmic_ prototypes have nothing to do with the Soc prototype, as they are specific for a driver. You should move them in the dialog header. I think I need create one head file named: include/dlg_pmic.h to include the pmic_reg_write/read declaration and not just put the declaration to da9053.h file, what's your idea? Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V7 2/3] PMIC: Add dialog pmic support
Hi, Stefano, 2011/5/12 Stefano Babic sba...@denx.de: On 05/11/2011 10:03 AM, Jason Liu wrote: This patch add dialog pmic(DA9053) driver with I2C interface support In order to not duplicate code and according to the discussion on the mail-list, change fsl_pmic.c to spi_i2c_pmic.c.Actaully,spi_i2c_pmic.c is just a wrapper for PMIC communication when SPI or I2C is used. Signed-off-by: Jason Liu jason@linaro.org Cc: sba...@denx.de sba...@denx.de Cc: Detlev Zundel d...@denx.de Hi Jason, --- a/drivers/misc/fsl_pmic.c +++ b/drivers/misc/spi_i2c_pmic.c @@ -22,13 +22,16 @@ #include config.h #include common.h +#include i2c.h #include asm/errno.h #include linux/types.h +#if defined(CONFIG_FSL_PMIC) #include fsl_pmic.h +#endif -static int check_param(u32 reg, u32 write) +static int check_param(u32 reg, u32 write, u32 max_reg) { - if (reg 63 || write 1) { + if (reg max_reg || write 1) { printf(reg num = %d is invalid. Should be less then 63\n, reg); return -1; @@ -37,15 +40,13 @@ static int check_param(u32 reg, u32 write) return 0; } -#ifdef CONFIG_FSL_PMIC_I2C -#include i2c.h - -u32 pmic_reg(u32 reg, u32 val, u32 write) +#if defined(CONFIG_FSL_PMIC_I2C) +u32 fsl_pmic_reg(u32 reg, u32 val, u32 write) { - unsigned char buf[4] = { 0 }; u32 ret_val = 0; + unsigned char buf[4] = { 0 }; - if (check_param(reg, write)) + if (check_param(reg, write, 63)) return -1; if (write) { @@ -62,7 +63,44 @@ u32 pmic_reg(u32 reg, u32 val, u32 write) return ret_val; } -#else /* SPI interface */ +#endif + +#if defined(CONFIG_DIALOG_PMIC_I2C) +u32 dlg_pmic_reg(u32 reg, u32 val, u32 write) +{ + u32 ret_val = 0; + unsigned char buf[1] = { 0 }; + + if (check_param(reg, write, 142)) + return -1; + + if (write) { + buf[0] = (val) 0xff; + if (i2c_write(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR, reg, 1, buf, 1)) + return -1; + } else { + if (i2c_read(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR, reg, 1, buf, 1)) + return -1; + ret_val = buf[0]; + } + + return ret_val; This is not what I meant. You have duplicated the code, instead of merge the two functions together. And I think the switch is wrong. This file provides a general access to PMIc using SPI/I2C. There should not be #ifdef related to a single PMIC. Instead of that, You need additional CONFIG_ to select how to access the PMIC (8 bit or 32 bit). Then can we have the CONFIG_SYS_DIALOG_PMIC_I2C_ADDR or CONFIG_SYS_FSL_PMIC_I2C_ADDR in this file? Please tell clear about your mean, don't let me guess what you mean? IMHO we can rid of the check_param() function, as this is a constraint to have an implementation independent from a single PMIC. If you think we don't need check_param, then It's ok. I can remove it. Since this function is added by you before. I would prefer something like this: u32 pmic_reg(u32 reg, u32 val, u32 write) { #ifdef CONFIG_SYS_PMIC_8BIT read / write 8 bit register #else actual implementation for fsl PMICs #endif Then what you prefer is function pointer or something else? Please tell clear, otherwise, it will cost another time to do it. +#if defined(CONFIG_FSL_PMIC_I2C) || defined(CONFIG_DIALOG_PMIC_I2C) Same comments apply here. We should select only between I2C and SPI, not the chip. +#if defined(CONFIG_FSL_PMIC) +#define PMIC_NAME Freescale PMIC (Atlas) +#elif defined(CONFIG_DIALOG_PMIC) +#define PMIC_NAME Dialog PMIC (DA905x) +#else +#error Unkown PMIC name +#endif Instead of that, we can set a general name or put the PMIC_NAME inside the specific PMIC header file. Then what general name you think it's good? I have seen the painful for restructure with the second time, another is the make imximage. Can we avoid it in the future? And BTW, do you have any comments about the 1/3 clock patch? If you have, please tell it as early as possible and I don't want to let the patch version goes up very bigger and the time endless. Thanks, Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 1/1] mx5: board: code clean up for checkboard code
Hi, Stefano, 2011/4/22 Jason Liu jason@linaro.org: The boot cause code has been factor out to soc common code,we need drop the part from the board support code This patch also remove the redundant cpu version print Signed-off-by: Jason Liu jason@linaro.org --- changes since v1 -include more clean up by remove the redundant cpu version print --- board/efikamx/efikamx.c | 42 + board/freescale/mx51evk/mx51evk.c | 36 +-- board/freescale/mx53evk/mx53evk.c | 21 +- board/ttcontrol/vision2/vision2.c | 42 + 4 files changed, 4 insertions(+), 137 deletions(-) Ping, any comments about this patch? Jason ___ 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 V7 3/3] MX53: support for freescale MX53LOCO board
This patch add initial support for freescale MX53LOCO board. Network(FEC),SD/MMC,UART have been supported by this patch The patch also config CPU:1GHZ,DDR:400MHZ for better peformance Signed-off-by: Jason Liu jason@linaro.org --- Changes since v5: - merge the Add power init support patch changes since v4: - remove the boot reset cause from board support changes since v3: - include other two small patch into this commit, mx53loco: set mmc env to MMC slot1 MX5: Enable flat-device-tree support on mx53 loco board changes since V2: -factor out the boot cause function to common code, -fix gd-ram_size with full memory size -remove the '1' from all #defines that just enable features -correct memory test end address value --- MAINTAINERS |1 + arch/arm/cpu/armv7/mx5/soc.c |2 +- arch/arm/include/asm/arch-mx5/sys_proto.h |2 + board/freescale/mx53loco/Makefile | 47 board/freescale/mx53loco/imximage.cfg | 96 +++ board/freescale/mx53loco/mx53loco.c | 395 + boards.cfg|1 + include/configs/mx53loco.h| 199 +++ 8 files changed, 742 insertions(+), 1 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index e2a4ba9..42c5048 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -574,6 +574,7 @@ Stefano Babic sba...@denx.de Jason Liu r64...@freescale.com mx53evk i.MX53 + mx53locoi.MX53 Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c index 6f4e8db..9c03474 100644 --- a/arch/arm/cpu/armv7/mx5/soc.c +++ b/arch/arm/cpu/armv7/mx5/soc.c @@ -116,7 +116,7 @@ int print_cpuinfo(void) (cpurev 0x000F0) 4, (cpurev 0xF) 0, mxc_get_clock(MXC_ARM_CLK) / 100); - printf(Reset cause: %s\n, get_reset_cause()); + printf(Reset cause: %s\n, get_reset_cause()); return 0; } #endif diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h b/arch/arm/include/asm/arch-mx5/sys_proto.h index f687503..2d7e9ed 100644 --- a/arch/arm/include/asm/arch-mx5/sys_proto.h +++ b/arch/arm/include/asm/arch-mx5/sys_proto.h @@ -27,5 +27,7 @@ u32 get_cpu_rev(void); #define is_soc_rev(rev)((get_cpu_rev() 0xFF) - rev) void sdelay(unsigned long); +void pmic_reg_write(u32 reg, u32 value); +u32 pmic_reg_read(u32 reg); #endif diff --git a/board/freescale/mx53loco/Makefile b/board/freescale/mx53loco/Makefile new file mode 100644 index 000..2088a48 --- /dev/null +++ b/board/freescale/mx53loco/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx53loco.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx53loco/imximage.cfg b/board/freescale/mx53loco/imximage.cfg new file mode 100644 index 000..ce9c8fc --- /dev/null +++ b/board/freescale/mx53loco/imximage.cfg @@ -0,0 +1,96 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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
[U-Boot] [PATCH V7 2/3] PMIC: Add dialog pmic support
This patch add dialog pmic(DA9053) driver with I2C interface support In order to not duplicate code and according to the discussion on the mail-list, change fsl_pmic.c to spi_i2c_pmic.c.Actaully,spi_i2c_pmic.c is just a wrapper for PMIC communication when SPI or I2C is used. Signed-off-by: Jason Liu jason@linaro.org Cc: sba...@denx.de sba...@denx.de Cc: Detlev Zundel d...@denx.de --- change since v1: - use one file to support fsl pmic and dialog pmic - rename fsl_pmic.c to spi_i2c_pmic.c --- drivers/misc/Makefile |3 +- drivers/misc/{fsl_pmic.c = spi_i2c_pmic.c} | 72 +-- include/da9053.h| 186 +++ 3 files changed, 248 insertions(+), 13 deletions(-) diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index b152486..b2e150e 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -26,9 +26,10 @@ include $(TOPDIR)/config.mk LIB:= $(obj)libmisc.o COBJS-$(CONFIG_ALI152X) += ali512x.o +COBJS-$(CONFIG_DIALOG_PMIC) += spi_i2c_pmic.o COBJS-$(CONFIG_DS4510) += ds4510.o COBJS-$(CONFIG_FSL_LAW) += fsl_law.o -COBJS-$(CONFIG_FSL_PMIC) += fsl_pmic.o +COBJS-$(CONFIG_FSL_PMIC) += spi_i2c_pmic.o COBJS-$(CONFIG_GPIO_LED) += gpio_led.o COBJS-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o COBJS-$(CONFIG_NS87308) += ns87308.o diff --git a/drivers/misc/fsl_pmic.c b/drivers/misc/spi_i2c_pmic.c similarity index 76% rename from drivers/misc/fsl_pmic.c rename to drivers/misc/spi_i2c_pmic.c index ef80ad9..5fbfb40 100644 --- a/drivers/misc/fsl_pmic.c +++ b/drivers/misc/spi_i2c_pmic.c @@ -22,13 +22,16 @@ #include config.h #include common.h +#include i2c.h #include asm/errno.h #include linux/types.h +#if defined(CONFIG_FSL_PMIC) #include fsl_pmic.h +#endif -static int check_param(u32 reg, u32 write) +static int check_param(u32 reg, u32 write, u32 max_reg) { - if (reg 63 || write 1) { + if (reg max_reg || write 1) { printf(reg num = %d is invalid. Should be less then 63\n, reg); return -1; @@ -37,15 +40,13 @@ static int check_param(u32 reg, u32 write) return 0; } -#ifdef CONFIG_FSL_PMIC_I2C -#include i2c.h - -u32 pmic_reg(u32 reg, u32 val, u32 write) +#if defined(CONFIG_FSL_PMIC_I2C) +u32 fsl_pmic_reg(u32 reg, u32 val, u32 write) { - unsigned char buf[4] = { 0 }; u32 ret_val = 0; + unsigned char buf[4] = { 0 }; - if (check_param(reg, write)) + if (check_param(reg, write, 63)) return -1; if (write) { @@ -62,7 +63,44 @@ u32 pmic_reg(u32 reg, u32 val, u32 write) return ret_val; } -#else /* SPI interface */ +#endif + +#if defined(CONFIG_DIALOG_PMIC_I2C) +u32 dlg_pmic_reg(u32 reg, u32 val, u32 write) +{ + u32 ret_val = 0; + unsigned char buf[1] = { 0 }; + + if (check_param(reg, write, 142)) + return -1; + + if (write) { + buf[0] = (val) 0xff; + if (i2c_write(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR, reg, 1, buf, 1)) + return -1; + } else { + if (i2c_read(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR, reg, 1, buf, 1)) + return -1; + ret_val = buf[0]; + } + + return ret_val; +} +#endif + +#if defined(CONFIG_FSL_PMIC_I2C) || defined(CONFIG_DIALOG_PMIC_I2C) +#include i2c.h +u32 pmic_reg(u32 reg, u32 val, u32 write) +{ +#if defined(CONFIG_FSL_PMIC_I2C) + return fsl_pmic_reg(reg, val, write); +#endif + +#if defined(CONFIG_DIALOG_PMIC_I2C) + return dlg_pmic_reg(reg, val, write); +#endif +} +#elif defined(CONFIG_FSL_PMIC) /* SPI interface */ #include spi.h static struct spi_slave *slave; @@ -92,7 +130,7 @@ u32 pmic_reg(u32 reg, u32 val, u32 write) return -1; } - if (check_param(reg, write)) + if (check_param(reg, write, 63)) return -1; if (spi_claim_bus(slave)) @@ -135,6 +173,7 @@ u32 pmic_reg_read(u32 reg) void pmic_show_pmic_info(void) { +#if defined(CONFIG_FSL_PMIC) u32 rev_id; rev_id = pmic_reg_read(REG_IDENTIFICATION); @@ -178,6 +217,7 @@ void pmic_show_pmic_info(void) break; } puts(]\n); +#endif } static void pmic_dump(int numregs) @@ -189,7 +229,7 @@ static void pmic_dump(int numregs) for (i = 0; i numregs; i++) { val = pmic_reg_read(i); if (!(i % 8)) - printf (\n0x%02x: , i); + printf(\n0x%02x: , i); printf(%08x , val); } puts(\n); @@ -227,9 +267,17 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; } +#if defined(CONFIG_FSL_PMIC) +#define PMIC_NAME Freescale PMIC (Atlas) +#elif defined(CONFIG_DIALOG_PMIC) +#define PMIC_NAME Dialog PMIC (DA905x) +#else +#error Unkown PMIC name +#endif + U_BOOT_CMD( pmic
[U-Boot] [PATCH V7 1/3] MX5: clock: Add clock config interface
Add clock config interface support, so that we can configure CPU or DDR clock in the later init Signed-off-by: Jason Liu jason@linaro.org --- arch/arm/cpu/armv7/mx5/clock.c | 551 +- arch/arm/include/asm/arch-mx5/clock.h|4 + arch/arm/include/asm/arch-mx5/crm_regs.h |6 + arch/arm/include/asm/arch-mx5/imx-regs.h |1 + 4 files changed, 559 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c index 0b04a88..04d9f71 100644 --- a/arch/arm/cpu/armv7/mx5/clock.c +++ b/arch/arm/cpu/armv7/mx5/clock.c @@ -24,6 +24,7 @@ */ #include common.h +#include div64.h #include asm/io.h #include asm/errno.h #include asm/arch/imx-regs.h @@ -34,6 +35,7 @@ enum pll_clocks { PLL1_CLOCK = 0, PLL2_CLOCK, PLL3_CLOCK, + PLL4_CLOCK, PLL_CLOCKS, }; @@ -41,8 +43,42 @@ struct mxc_pll_reg *mxc_plls[PLL_CLOCKS] = { [PLL1_CLOCK] = (struct mxc_pll_reg *)PLL1_BASE_ADDR, [PLL2_CLOCK] = (struct mxc_pll_reg *)PLL2_BASE_ADDR, [PLL3_CLOCK] = (struct mxc_pll_reg *)PLL3_BASE_ADDR, + [PLL4_CLOCK] = (struct mxc_pll_reg *)PLL4_BASE_ADDR, }; +#define AHB_CLK_ROOT1 +#define SZ_DEC_1M 100 +#define PLL_PD_MAX 16 /* Actual pd+1 */ +#define PLL_MFI_MAX 15 +#define PLL_MFI_MIN 5 +#define ARM_DIV_MAX 8 +#define IPG_DIV_MAX 4 +#define AHB_DIV_MAX 8 +#define EMI_DIV_MAX 8 +#define NFC_DIV_MAX 8 + +struct fixed_pll_mfd { + u32 ref_clk_hz; + u32 mfd; +}; + +const struct fixed_pll_mfd fixed_mfd[] = { + {CONFIG_SYS_MX5_HCLK, 24 * 16}, +}; + +struct pll_param { + u32 pd; + u32 mfi; + u32 mfn; + u32 mfd; +}; + +#define PLL_FREQ_MAX(ref_clk) (4 * (ref_clk) * PLL_MFI_MAX) +#define PLL_FREQ_MIN(ref_clk) \ + ((2 * (ref_clk) * (PLL_MFI_MIN - 1)) / PLL_PD_MAX) +#define MAX_DDR_CLK 42000 +#define NFC_CLK_MAX 3400 + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE; /* @@ -175,7 +211,7 @@ static u32 get_uart_clk(void) /* * This function returns the low power audio clock. */ -u32 get_lp_apm(void) +static u32 get_lp_apm(void) { u32 ret_val = 0; u32 ccsr = __raw_readl(mxc_ccm-ccsr); @@ -191,7 +227,7 @@ u32 get_lp_apm(void) /* * get cspi clock rate. */ -u32 imx_get_cspiclk(void) +static u32 get_cspi_clk(void) { u32 ret_val = 0, pdf, pre_pdf, clk_sel; u32 cscmr1 = __raw_readl(mxc_ccm-cscmr1); @@ -228,6 +264,94 @@ u32 imx_get_cspiclk(void) return ret_val; } +static u32 get_axi_a_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_AXI_A_PODF_MASK) \ +MXC_CCM_CBCDR_AXI_A_PODF_OFFSET; + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_axi_b_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_AXI_B_PODF_MASK) \ +MXC_CCM_CBCDR_AXI_B_PODF_OFFSET; + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_ahb_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_AHB_PODF_MASK) \ +MXC_CCM_CBCDR_AHB_PODF_OFFSET; + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_emi_slow_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 emi_clk_sel = cbcdr MXC_CCM_CBCDR_EMI_CLK_SEL; + u32 pdf = (cbcdr MXC_CCM_CBCDR_EMI_PODF_MASK) \ +MXC_CCM_CBCDR_EMI_PODF_OFFSET; + + if (emi_clk_sel) + return get_ahb_clk() / (pdf + 1); + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_nfc_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_NFC_PODF_MASK) \ +MXC_CCM_CBCDR_NFC_PODF_OFFSET; + + return get_emi_slow_clk() / (pdf + 1); +} + +static u32 get_ddr_clk(void) +{ + u32 ret_val = 0; + u32 cbcmr = __raw_readl(mxc_ccm-cbcmr); + u32 ddr_clk_sel = (cbcmr MXC_CCM_CBCMR_DDR_CLK_SEL_MASK) \ +MXC_CCM_CBCMR_DDR_CLK_SEL_OFFSET; +#ifdef CONFIG_MX51 + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + if (cbcdr MXC_CCM_CBCDR_DDR_HIFREQ_SEL) { + u32 ddr_clk_podf = (cbcdr MXC_CCM_CBCDR_DDR_PODF_MASK) \ + MXC_CCM_CBCDR_DDR_PODF_OFFSET; + + ret_val = decode_pll(mxc_plls[PLL1_CLOCK], CONFIG_SYS_MX5_HCLK); + ret_val /= ddr_clk_podf + 1; + + return ret_val; + } +#endif + switch (ddr_clk_sel) { + case 0: + ret_val = get_axi_a_clk(); + break; + case 1: + ret_val = get_axi_b_clk(); + break; + case 2: + ret_val = get_emi_slow_clk(); + break; + case
Re: [U-Boot] [PATCH V6 2/3] PMIC: Add dialog pmic support
Hi, Stefano, 2011/4/27 Stefano Babic sba...@denx.de: On 04/27/2011 11:39 AM, Detlev Zundel wrote: Then why not rename the driver to something else than fsl_pmic? Maybe this is what Jason really is asking? Yes, of course, no problem at all. Jason, if you meant to drop the fsl_ to make the driver more general, I completely agree. Sorry, I have not got the point. Sorry for the late response due to some reason. :( Yes, We had better rename fsl_ to something else, I would like use generic_pmic or something else, what's your idea? Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] mx5: drop boot cause code from board support code
Hi, Stefano, 2011/4/22 Stefano Babic sba...@denx.de: On 04/22/2011 07:45 AM, Jason Hui wrote: Hi, Stefano, Hi Jason, int checkboard(void) { u32 system_rev = get_cpu_rev(); - u32 cause; - struct src *src_regs = (struct src *)SRC_BASE_ADDR; This seems to me not the best solution. If we have now factored out code to print the reset cause and the silicon version (inside print_cpuinfo), why do we need to repeat this code for each board ? Calling get_cpu_rev seems to me redundant (then each board should only set CONFIG_DISPLAY_CPUINFO). And then the CPU revision is printed again, and this is redundant. The purpose for this patch is to remove the boot cause code and and don't change any cpu rev code. The cpu rev part of code is as it is as before. However, it seems to me a half-way clean up. As we have already factorize function for printing the cpu revision and the reset cause, I will see in the checkboard only board related information. If there is no revision number for board, printing only the board name as you make for the LOCO is correct. Taking as example the efika board (all boards make the same): puts(Board: Efika MX ); switch (system_rev 0xff) { The only new information is the board name. If I am not wrong, system_rev 0xff contains only the cpu revision, and the switch prints out the silicon version. Everything already done in print_cpuinfo as well. Ditto, as I only remove the boot cause part of code as the patch tile said. Yes, but this it is redundant with the print_cpuinfo(). As you plan to clean up the code, this part should be cleaned up as well. Or do you think there is something not covered by the common code ? I think we need more clean up, removing all part related to CPU revision and leaving (if any) only the output related to the board revision. If that, I need change the patch tile, and include more clean up in the patch and send again. Agree. OK, I will re-send the patch with more clean-up. Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 2/2] MX53: support for freescale MX53LOCO board
Hi, Stefano, 2011/4/22 Stefano Babic sba...@denx.de: On 04/22/2011 06:36 AM, Jason Hui wrote: OK, I will resend the patchset as the following layout: MX5: clock: Add clock config interface MX5: factor out boot cause funciton to common code PMIC: Add dialog pmic support MX53: support for freescale MX53LOCO board (merge Add power init support) I will rebase on the u-boot-imx git, do you think is it OK? Yes, thanks. +#define CONFIG_SYS_MEMTEST_START 0x7000 +#define CONFIG_SYS_MEMTEST_END 0x7001 There is still an open question about this range. Can you answer to Wolfgang's question ? In fact, I want to give one simple test range when use mtest, I don't know what you are worrying about, please tell it clearly? I think the only issue is if there is some reasons to set the test range to only 64KB, except the fact this was the value set for the mx51evk. If you do not see any special reasons, you could increase the CONFIG_SYS_MEMTEST_END to a larger value. Is there any rule that we need must follow to set the CONFIG_SYS_MEMTEST_START CONFIG_SYS_MEMTEST_END ?? If no, I think the value we set is free. Here I set for 64KB is just for simple and quick test, there is no other reasons. In fact, mtest command line can override the value. What the value you think I need set? Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 1/1] mx5: board: code clean up for checkboard code
The boot cause code has been factor out to soc common code,we need drop the part from the board support code This patch also remove the redundant cpu version print Signed-off-by: Jason Liu jason@linaro.org --- changes since v1 -include more clean up by remove the redundant cpu version print --- board/efikamx/efikamx.c | 42 + board/freescale/mx51evk/mx51evk.c | 36 +-- board/freescale/mx53evk/mx53evk.c | 21 +- board/ttcontrol/vision2/vision2.c | 42 + 4 files changed, 4 insertions(+), 137 deletions(-) diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c index f735260..16be532 100644 --- a/board/efikamx/efikamx.c +++ b/board/efikamx/efikamx.c @@ -643,47 +643,7 @@ int board_late_init(void) int checkboard(void) { - u32 system_rev = get_cpu_rev(); - u32 cause; - struct src *src_regs = (struct src *)SRC_BASE_ADDR; - - puts(Board: Efika MX ); - - switch (system_rev 0xff) { - case CHIP_REV_3_0: - puts(3.0 [); - break; - case CHIP_REV_2_5: - puts(2.5 [); - break; - case CHIP_REV_2_0: - puts(2.0 [); - break; - case CHIP_REV_1_1: - puts(1.1 [); - break; - case CHIP_REV_1_0: - default: - puts(1.0 [); - break; - } - - cause = src_regs-srsr; - switch (cause) { - case 0x0001: - puts(POR); - break; - case 0x0009: - puts(RST); - break; - case 0x0010: - case 0x0011: - puts(WDOG); - break; - default: - printf(unknown 0x%x, cause); - } - puts(]\n); + puts(Board: Efika MX\n); return 0; } diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 02a765d..e2d3d74 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -431,41 +431,7 @@ int board_late_init(void) int checkboard(void) { - puts(Board: MX51EVK ); - - switch (system_rev 0xff) { - case CHIP_REV_3_0: - puts(3.0 [); - break; - case CHIP_REV_2_5: - puts(2.5 [); - break; - case CHIP_REV_2_0: - puts(2.0 [); - break; - case CHIP_REV_1_1: - puts(1.1 [); - break; - case CHIP_REV_1_0: - default: - puts(1.0 [); - break; - } + puts(Board: MX51EVK\n); - switch (__raw_readl(SRC_BASE_ADDR + 0x8)) { - case 0x0001: - puts(POR); - break; - case 0x0009: - puts(RST); - break; - case 0x0010: - case 0x0011: - puts(WDOG); - break; - default: - puts(unknown); - } - puts(]\n); return 0; } diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index e71701b..a89aa25 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -372,26 +372,7 @@ int board_late_init(void) int checkboard(void) { - u32 cause; - struct src *src_regs = (struct src *)SRC_BASE_ADDR; + puts(Board: MX53EVK\n); - puts(Board: MX53EVK [); - - cause = src_regs-srsr; - switch (cause) { - case 0x0001: - printf(POR); - break; - case 0x0009: - printf(RST); - break; - case 0x0010: - case 0x0011: - printf(WDOG); - break; - default: - printf(unknown); - } - printf(]\n); return 0; } diff --git a/board/ttcontrol/vision2/vision2.c b/board/ttcontrol/vision2/vision2.c index f8ef4fc..7f37bad 100644 --- a/board/ttcontrol/vision2/vision2.c +++ b/board/ttcontrol/vision2/vision2.c @@ -700,47 +700,7 @@ int board_late_init(void) int checkboard(void) { - u32 system_rev = get_cpu_rev(); - u32 cause; - struct src *src_regs = (struct src *)SRC_BASE_ADDR; - - puts(Board: TTControl Vision II CPU V); - - switch (system_rev 0xff) { - case CHIP_REV_3_0: - puts(3.0 [); - break; - case CHIP_REV_2_5: - puts(2.5 [); - break; - case CHIP_REV_2_0: - puts(2.0 [); - break; - case CHIP_REV_1_1: - puts(1.1 [); - break; - case CHIP_REV_1_0: - default: - puts(1.0 [); - break; - } - - cause = src_regs-srsr; - switch (cause) { - case 0x0001: - puts(POR); - break; - case 0x0009: - puts(RST
[U-Boot] [PATCH V6 1/3] MX5: clock: Add clock config interface
Add clock config interface support, so that we can configure CPU or DDR clock in the later init Signed-off-by: Jason Liu jason@linaro.org --- arch/arm/cpu/armv7/mx5/clock.c | 551 +- arch/arm/include/asm/arch-mx5/clock.h|4 + arch/arm/include/asm/arch-mx5/crm_regs.h |6 + arch/arm/include/asm/arch-mx5/imx-regs.h |1 + 4 files changed, 559 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c index 0b04a88..04d9f71 100644 --- a/arch/arm/cpu/armv7/mx5/clock.c +++ b/arch/arm/cpu/armv7/mx5/clock.c @@ -24,6 +24,7 @@ */ #include common.h +#include div64.h #include asm/io.h #include asm/errno.h #include asm/arch/imx-regs.h @@ -34,6 +35,7 @@ enum pll_clocks { PLL1_CLOCK = 0, PLL2_CLOCK, PLL3_CLOCK, + PLL4_CLOCK, PLL_CLOCKS, }; @@ -41,8 +43,42 @@ struct mxc_pll_reg *mxc_plls[PLL_CLOCKS] = { [PLL1_CLOCK] = (struct mxc_pll_reg *)PLL1_BASE_ADDR, [PLL2_CLOCK] = (struct mxc_pll_reg *)PLL2_BASE_ADDR, [PLL3_CLOCK] = (struct mxc_pll_reg *)PLL3_BASE_ADDR, + [PLL4_CLOCK] = (struct mxc_pll_reg *)PLL4_BASE_ADDR, }; +#define AHB_CLK_ROOT1 +#define SZ_DEC_1M 100 +#define PLL_PD_MAX 16 /* Actual pd+1 */ +#define PLL_MFI_MAX 15 +#define PLL_MFI_MIN 5 +#define ARM_DIV_MAX 8 +#define IPG_DIV_MAX 4 +#define AHB_DIV_MAX 8 +#define EMI_DIV_MAX 8 +#define NFC_DIV_MAX 8 + +struct fixed_pll_mfd { + u32 ref_clk_hz; + u32 mfd; +}; + +const struct fixed_pll_mfd fixed_mfd[] = { + {CONFIG_SYS_MX5_HCLK, 24 * 16}, +}; + +struct pll_param { + u32 pd; + u32 mfi; + u32 mfn; + u32 mfd; +}; + +#define PLL_FREQ_MAX(ref_clk) (4 * (ref_clk) * PLL_MFI_MAX) +#define PLL_FREQ_MIN(ref_clk) \ + ((2 * (ref_clk) * (PLL_MFI_MIN - 1)) / PLL_PD_MAX) +#define MAX_DDR_CLK 42000 +#define NFC_CLK_MAX 3400 + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE; /* @@ -175,7 +211,7 @@ static u32 get_uart_clk(void) /* * This function returns the low power audio clock. */ -u32 get_lp_apm(void) +static u32 get_lp_apm(void) { u32 ret_val = 0; u32 ccsr = __raw_readl(mxc_ccm-ccsr); @@ -191,7 +227,7 @@ u32 get_lp_apm(void) /* * get cspi clock rate. */ -u32 imx_get_cspiclk(void) +static u32 get_cspi_clk(void) { u32 ret_val = 0, pdf, pre_pdf, clk_sel; u32 cscmr1 = __raw_readl(mxc_ccm-cscmr1); @@ -228,6 +264,94 @@ u32 imx_get_cspiclk(void) return ret_val; } +static u32 get_axi_a_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_AXI_A_PODF_MASK) \ +MXC_CCM_CBCDR_AXI_A_PODF_OFFSET; + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_axi_b_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_AXI_B_PODF_MASK) \ +MXC_CCM_CBCDR_AXI_B_PODF_OFFSET; + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_ahb_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_AHB_PODF_MASK) \ +MXC_CCM_CBCDR_AHB_PODF_OFFSET; + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_emi_slow_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 emi_clk_sel = cbcdr MXC_CCM_CBCDR_EMI_CLK_SEL; + u32 pdf = (cbcdr MXC_CCM_CBCDR_EMI_PODF_MASK) \ +MXC_CCM_CBCDR_EMI_PODF_OFFSET; + + if (emi_clk_sel) + return get_ahb_clk() / (pdf + 1); + + return get_periph_clk() / (pdf + 1); +} + +static u32 get_nfc_clk(void) +{ + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + u32 pdf = (cbcdr MXC_CCM_CBCDR_NFC_PODF_MASK) \ +MXC_CCM_CBCDR_NFC_PODF_OFFSET; + + return get_emi_slow_clk() / (pdf + 1); +} + +static u32 get_ddr_clk(void) +{ + u32 ret_val = 0; + u32 cbcmr = __raw_readl(mxc_ccm-cbcmr); + u32 ddr_clk_sel = (cbcmr MXC_CCM_CBCMR_DDR_CLK_SEL_MASK) \ +MXC_CCM_CBCMR_DDR_CLK_SEL_OFFSET; +#ifdef CONFIG_MX51 + u32 cbcdr = __raw_readl(mxc_ccm-cbcdr); + if (cbcdr MXC_CCM_CBCDR_DDR_HIFREQ_SEL) { + u32 ddr_clk_podf = (cbcdr MXC_CCM_CBCDR_DDR_PODF_MASK) \ + MXC_CCM_CBCDR_DDR_PODF_OFFSET; + + ret_val = decode_pll(mxc_plls[PLL1_CLOCK], CONFIG_SYS_MX5_HCLK); + ret_val /= ddr_clk_podf + 1; + + return ret_val; + } +#endif + switch (ddr_clk_sel) { + case 0: + ret_val = get_axi_a_clk(); + break; + case 1: + ret_val = get_axi_b_clk(); + break; + case 2: + ret_val = get_emi_slow_clk(); + break; + case
[U-Boot] [PATCH V6 2/3] PMIC: Add dialog pmic support
Add dialog pmic(DA9053) driver with I2C interface support Signed-off-by: Jason Liu jason@linaro.org --- drivers/misc/Makefile |1 + drivers/misc/dialog_pmic.c | 123 + include/da9053.h | 186 3 files changed, 310 insertions(+), 0 deletions(-) diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index b152486..c557a14 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -35,6 +35,7 @@ COBJS-$(CONFIG_NS87308) += ns87308.o COBJS-$(CONFIG_PDSP188x) += pdsp188x.o COBJS-$(CONFIG_STATUS_LED) += status_led.o COBJS-$(CONFIG_TWL4030_LED) += twl4030_led.o +COBJS-$(CONFIG_DIALOG_PMIC) += dialog_pmic.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/misc/dialog_pmic.c b/drivers/misc/dialog_pmic.c new file mode 100644 index 000..95dc6ea --- /dev/null +++ b/drivers/misc/dialog_pmic.c @@ -0,0 +1,123 @@ +/* + * (C) Copyright 2011 Freescale Semiconductor, Inc. + * Based on drivers/misc/fsl_pmic.c + * + * 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 + */ + +#include config.h +#include common.h +#include i2c.h +#include asm/errno.h +#include linux/types.h + +static int check_param(u32 reg, u32 write) +{ + if (reg 142 || write 1) { + printf(reg num = %d is invalid. Should be less then 142\n, + reg); + return -1; + } + + return 0; +} + +static u32 pmic_reg(u32 reg, u32 val, u32 write) +{ + unsigned char buf[1] = { 0 }; + u32 ret_val = 0; + + if (check_param(reg, write)) + return -1; + + if (write) { + buf[0] = (val) 0xff; + if (i2c_write(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR, reg, 1, buf, 1)) + return -1; + } else { + if (i2c_read(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR, reg, 1, buf, 1)) + return -1; + ret_val = buf[0]; + } + + return ret_val; +} + +void pmic_reg_write(u32 reg, u32 value) +{ + pmic_reg(reg, value, 1); +} + +u32 pmic_reg_read(u32 reg) +{ + return pmic_reg(reg, 0, 0); +} + +static void pmic_dump(int numregs) +{ + u32 val; + int i; + + for (i = 0; i numregs; i++) { + val = pmic_reg_read(i); + if (!(i % 8)) + printf(\n0x%02x: , i); + printf(%02x , val); + } + puts(\n); +} + +int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + char *cmd; + int nregs; + u32 val; + + /* at least two arguments please */ + if (argc 2) + return cmd_usage(cmdtp); + + cmd = argv[1]; + if (strcmp(cmd, dump) == 0) { + if (argc 3) + return cmd_usage(cmdtp); + + nregs = simple_strtoul(argv[2], NULL, 16); + pmic_dump(nregs); + return 0; + } + if (strcmp(cmd, write) == 0) { + if (argc 4) + return cmd_usage(cmdtp); + + nregs = simple_strtoul(argv[2], NULL, 16); + val = simple_strtoul(argv[3], NULL, 16); + pmic_reg_write(nregs, val); + return 0; + } + /* No subcommand found */ + return 1; +} + +U_BOOT_CMD( + pmic, CONFIG_SYS_MAXARGS, 1, do_pmic, + Dialog PMIC (DA905x), + dump [numregs] dump registers\n + pmic write reg value - write register +); diff --git a/include/da9053.h b/include/da9053.h new file mode 100644 index 000..f69408a --- /dev/null +++ b/include/da9053.h @@ -0,0 +1,186 @@ +/* + * da9053 register declarations. + * + * Copyright(c) 2009 Dialog Semiconductor Ltd. + * + * 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
[U-Boot] [PATCH V6 3/3] MX53: support for freescale MX53LOCO board
This patch add initial support for freescale MX53LOCO board. Network(FEC),SD/MMC,UART have been supported by this patch The patch also config CPU:1GHZ,DDR:400MHZ for better peformance Signed-off-by: Jason Liu jason@linaro.org --- Changes since v5: - merge the Add power init support patch changes since v4: - remove the boot reset cause from board support changes since v3: - include other two small patch into this commit, mx53loco: set mmc env to MMC slot1 MX5: Enable flat-device-tree support on mx53 loco board changes since V2: -factor out the boot cause function to common code, -fix gd-ram_size with full memory size -remove the '1' from all #defines that just enable features -correct memory test end address value --- MAINTAINERS |1 + arch/arm/cpu/armv7/mx5/soc.c |2 +- arch/arm/include/asm/arch-mx5/sys_proto.h |2 + board/freescale/mx53loco/Makefile | 47 board/freescale/mx53loco/imximage.cfg | 96 +++ board/freescale/mx53loco/mx53loco.c | 395 + boards.cfg|1 + include/configs/mx53loco.h| 198 +++ 8 files changed, 741 insertions(+), 1 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1299cbb..c00a196 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -567,6 +567,7 @@ Stefano Babic sba...@denx.de Jason Liu r64...@freescale.com mx53evk i.MX53 + mx53locoi.MX53 Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c index 6f4e8db..9c03474 100644 --- a/arch/arm/cpu/armv7/mx5/soc.c +++ b/arch/arm/cpu/armv7/mx5/soc.c @@ -116,7 +116,7 @@ int print_cpuinfo(void) (cpurev 0x000F0) 4, (cpurev 0xF) 0, mxc_get_clock(MXC_ARM_CLK) / 100); - printf(Reset cause: %s\n, get_reset_cause()); + printf(Reset cause: %s\n, get_reset_cause()); return 0; } #endif diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h b/arch/arm/include/asm/arch-mx5/sys_proto.h index f687503..2d7e9ed 100644 --- a/arch/arm/include/asm/arch-mx5/sys_proto.h +++ b/arch/arm/include/asm/arch-mx5/sys_proto.h @@ -27,5 +27,7 @@ u32 get_cpu_rev(void); #define is_soc_rev(rev)((get_cpu_rev() 0xFF) - rev) void sdelay(unsigned long); +void pmic_reg_write(u32 reg, u32 value); +u32 pmic_reg_read(u32 reg); #endif diff --git a/board/freescale/mx53loco/Makefile b/board/freescale/mx53loco/Makefile new file mode 100644 index 000..2088a48 --- /dev/null +++ b/board/freescale/mx53loco/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx53loco.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx53loco/imximage.cfg b/board/freescale/mx53loco/imximage.cfg new file mode 100644 index 000..ce9c8fc --- /dev/null +++ b/board/freescale/mx53loco/imximage.cfg @@ -0,0 +1,96 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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
Re: [U-Boot] [PATCH V6 2/3] PMIC: Add dialog pmic support
Hi, Stefano, 2011/4/22 Stefano Babic sba...@denx.de: On 04/22/2011 02:55 PM, Jason Liu wrote: Add dialog pmic(DA9053) driver with I2C interface support Hi Jason, diff --git a/drivers/misc/dialog_pmic.c b/drivers/misc/dialog_pmic.c new file mode 100644 index 000..95dc6ea --- /dev/null +++ b/drivers/misc/dialog_pmic.c @@ -0,0 +1,123 @@ +/* + * (C) Copyright 2011 Freescale Semiconductor, Inc. + * Based on drivers/misc/fsl_pmic.c As I can see now, this driver is quite a copy of fsl_pmic.c, with slightly changes. Are you sure we cannot simply change the already provided driver, adding support for the new chip ? I have not read the DA9053 datasheet, but from your patch it seems to me that the relevant changes are: - registers are 1 byte wide instead of 32 bit - different size of register area Really not enough to justify a new driver. All functions are really copied from the old one. Please consider to adapt fsl_pmic.c instead of adding a slightly different new one. fsl_pmic is about freescale mc13892 and fsl_pmic.c is dedicated for fsl pmic as you write this file, right? As I add the Dialog PMIC support, I do want to not add one new file, but I find it's not easy to add it and it will make the file very mess, so, I decide not to touch the original file and add one new file. The head of this file tell it clear that this patch is Based on drivers/misc/fsl_pmic.c. If you still want me to include the DA9053 support into fsl_pmic, could you please extend the fsl_pmic support to easily add another vender's pmic support first? Jason 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/1] mx5: drop boot cause code from board support code
The boot cause code has been factor out to soc common code,we need drop the part from the board support code Signed-off-by: Jason Liu jason@linaro.org --- board/efikamx/efikamx.c | 30 ++ board/freescale/mx51evk/mx51evk.c | 26 ++ board/freescale/mx53evk/mx53evk.c | 21 + board/ttcontrol/vision2/vision2.c | 28 ++-- 4 files changed, 19 insertions(+), 86 deletions(-) diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c index f735260..0aef654 100644 --- a/board/efikamx/efikamx.c +++ b/board/efikamx/efikamx.c @@ -644,46 +644,28 @@ int board_late_init(void) int checkboard(void) { u32 system_rev = get_cpu_rev(); - u32 cause; - struct src *src_regs = (struct src *)SRC_BASE_ADDR; puts(Board: Efika MX ); switch (system_rev 0xff) { case CHIP_REV_3_0: - puts(3.0 [); + puts(3.0); break; case CHIP_REV_2_5: - puts(2.5 [); + puts(2.5); break; case CHIP_REV_2_0: - puts(2.0 [); + puts(2.0); break; case CHIP_REV_1_1: - puts(1.1 [); + puts(1.1); break; case CHIP_REV_1_0: default: - puts(1.0 [); + puts(1.0); break; } - cause = src_regs-srsr; - switch (cause) { - case 0x0001: - puts(POR); - break; - case 0x0009: - puts(RST); - break; - case 0x0010: - case 0x0011: - puts(WDOG); - break; - default: - printf(unknown 0x%x, cause); - } - puts(]\n); - + puts(\n); return 0; } diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 02a765d..cff2ff1 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -435,37 +435,23 @@ int checkboard(void) switch (system_rev 0xff) { case CHIP_REV_3_0: - puts(3.0 [); + puts(3.0); break; case CHIP_REV_2_5: - puts(2.5 [); + puts(2.5); break; case CHIP_REV_2_0: - puts(2.0 [); + puts(2.0); break; case CHIP_REV_1_1: - puts(1.1 [); + puts(1.1); break; case CHIP_REV_1_0: default: - puts(1.0 [); + puts(1.0); break; } - switch (__raw_readl(SRC_BASE_ADDR + 0x8)) { - case 0x0001: - puts(POR); - break; - case 0x0009: - puts(RST); - break; - case 0x0010: - case 0x0011: - puts(WDOG); - break; - default: - puts(unknown); - } - puts(]\n); + puts(\n); return 0; } diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index e71701b..a89aa25 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -372,26 +372,7 @@ int board_late_init(void) int checkboard(void) { - u32 cause; - struct src *src_regs = (struct src *)SRC_BASE_ADDR; + puts(Board: MX53EVK\n); - puts(Board: MX53EVK [); - - cause = src_regs-srsr; - switch (cause) { - case 0x0001: - printf(POR); - break; - case 0x0009: - printf(RST); - break; - case 0x0010: - case 0x0011: - printf(WDOG); - break; - default: - printf(unknown); - } - printf(]\n); return 0; } diff --git a/board/ttcontrol/vision2/vision2.c b/board/ttcontrol/vision2/vision2.c index f8ef4fc..8423110 100644 --- a/board/ttcontrol/vision2/vision2.c +++ b/board/ttcontrol/vision2/vision2.c @@ -708,40 +708,24 @@ int checkboard(void) switch (system_rev 0xff) { case CHIP_REV_3_0: - puts(3.0 [); + puts(3.0); break; case CHIP_REV_2_5: - puts(2.5 [); + puts(2.5); break; case CHIP_REV_2_0: - puts(2.0 [); + puts(2.0); break; case CHIP_REV_1_1: - puts(1.1 [); + puts(1.1); break; case CHIP_REV_1_0: default: - puts(1.0 [); + puts(1.0); break; } - cause = src_regs-srsr; - switch (cause) { - case 0x0001: - puts(POR); - break; - case 0x0009: - puts(RST); - break; - case 0x0010
[U-Boot] [PATCH V5 1/2] MX5: factor out boot cause funciton to common code
factor out boot cause funciton to common code to avoid the duplicate code in each board support package Signed-off-by: Jason Liu jason@linaro.org --- change since v4: - make common code soc specific changes since v3: - add full boot reset cause --- arch/arm/cpu/armv7/mx5/soc.c | 28 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c index 09500b3..6f4e8db 100644 --- a/arch/arm/cpu/armv7/mx5/soc.c +++ b/arch/arm/cpu/armv7/mx5/soc.c @@ -77,6 +77,33 @@ u32 get_cpu_rev(void) return system_rev; } +static char *get_reset_cause(void) +{ + u32 cause; + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + + cause = readl(src_regs-srsr); + writel(cause, src_regs-srsr); + + switch (cause) { + case 0x1: + return POR; + case 0x4: + return CSU; + case 0x8: + return IPP USER; + case 0x00010: + return WDOG; + case 0x00020: + return JTAG HIGH-Z; + case 0x00040: + return JTAG SW; + case 0x1: + return WARM BOOT; + default: + return unknown reset; + } +} #if defined(CONFIG_DISPLAY_CPUINFO) int print_cpuinfo(void) @@ -89,6 +116,7 @@ int print_cpuinfo(void) (cpurev 0x000F0) 4, (cpurev 0xF) 0, mxc_get_clock(MXC_ARM_CLK) / 100); + printf(Reset cause: %s\n, get_reset_cause()); return 0; } #endif -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V5 2/2] MX53: support for freescale MX53LOCO board
This patch add initial support for freescale MX53LOCO board. Network(FEC),SD/MMC, UART have been supported by this patch. Signed-off-by: Jason Liu jason@linaro.org --- changes since v4: - remove the boot reset cause from board support changes since v3: - include other two small patch into this commit, mx53loco: set mmc env to MMC slot1 MX5: Enable flat-device-tree support on mx53 loco board changes since V2: -factor out the boot cause function to common code, -fix gd-ram_size with full memory size -remove the '1' from all #defines that just enable features -correct memory test end address value --- MAINTAINERS |1 + arch/arm/cpu/armv7/mx5/soc.c |2 +- board/freescale/mx53loco/Makefile | 47 + board/freescale/mx53loco/imximage.cfg | 96 +++ board/freescale/mx53loco/mx53loco.c | 301 + boards.cfg|1 + include/configs/mx53loco.h| 199 ++ 7 files changed, 646 insertions(+), 1 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4756f14..7c311f7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -567,6 +567,7 @@ Stefano Babic sba...@denx.de Jason Liu r64...@freescale.com mx53evk i.MX53 + mx53locoi.MX53 Enric Balletbo i Serra eballe...@iseebcn.com diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c index 6f4e8db..9c03474 100644 --- a/arch/arm/cpu/armv7/mx5/soc.c +++ b/arch/arm/cpu/armv7/mx5/soc.c @@ -116,7 +116,7 @@ int print_cpuinfo(void) (cpurev 0x000F0) 4, (cpurev 0xF) 0, mxc_get_clock(MXC_ARM_CLK) / 100); - printf(Reset cause: %s\n, get_reset_cause()); + printf(Reset cause: %s\n, get_reset_cause()); return 0; } #endif diff --git a/board/freescale/mx53loco/Makefile b/board/freescale/mx53loco/Makefile new file mode 100644 index 000..2088a48 --- /dev/null +++ b/board/freescale/mx53loco/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := mx53loco.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/freescale/mx53loco/imximage.cfg b/board/freescale/mx53loco/imximage.cfg new file mode 100644 index 000..ce9c8fc --- /dev/null +++ b/board/freescale/mx53loco/imximage.cfg @@ -0,0 +1,96 @@ +# Copyright (C) 2011 Freescale Semiconductor, Inc. +# Jason Liu r64...@freescale.com +# +# 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. 51 Franklin Street Fifth Floor Boston, +# MA 02110-1301 USA +# +# Refer docs/README.imxmage for more details about how-to configure +# and create imximage boot image +# +# The syntax is taken as close as possible with the kwbimage + +# image version + +IMAGE_VERSION 2 + +# Boot Device : one of +# spi, sd (the board has no nand neither onenand) + +BOOT_FROM sd + +# Device Configuration Data (DCD) +# +# Each entry must have the format
Re: [U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code
Hi, Stefano, 2011/4/20 Stefano Babic sba...@denx.de: On 04/18/2011 11:19 AM, Detlev Zundel wrote: Hi Stefano, On 04/15/2011 02:47 PM, Fabio Estevam wrote: +char *get_reset_cause(void) +{ + u32 cause; + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + + cause = readl(src_regs-srsr); You need to mask the 7 LSB of SRSR register. If you don´t bit 16 can still affect its result. Why ? As this becomes a general function for i.MX5, should we not provide a way to check all significant bits ? Why should we exclude the warm boot bit to be checked and printed out ? And _please_ (as indictated in my i.MX31 mail) use the code for _all_ iMX51 boards withoput the need for them to call a function and print the result. Jason, I noted only now that this comment was not directly addressed to you, but it is related to your patch. As you see for the i.MX31, the result of the discussion was to call the get_reset_cause() inside the print_cpuinfo() function, to make automatically this function available for all MX5 boards. Yes, I have send out the v5 patch for it. please review it. Thanks, Jason 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 V4 1/2] MX5: factor out boot cause funciton to common code
Hi, Stefano, 2011/4/16 Jason Liu r64...@freescale.com: From: Liu Hui-R64343 r64...@freescale.com factor out boot cause funciton to common code to avoid the duplicate code in each board support package Signed-off-by: Jason Liu r64...@freescale.com --- changes since v3: - add full boot reset cause Ping, any comments? 1.7.1 ___ 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
Re: [U-Boot] [PATCH V4 2/2] MX53: support for freescale MX53LOCO board
Hi, Stefano, 2011/4/16 Jason Liu r64...@freescale.com: From: Liu Hui-R64343 r64...@freescale.com This patch add initial support for freescale MX53LOCO board. Network(FEC),SD/MMC, UART have been supported by this patch. Signed-off-by: Jason Liu r64...@freescale.com --- changes since v3: - include other two small patch into this commit, mx53loco: set mmc env to MMC slot1 MX5: Enable flat-device-tree support on mx53 loco board changes since V2: -factor out the boot cause function to common code, -fix gd-ram_size with full memory size -remove the '1' from all #defines that just enable features -correct memory test end address value Ping, any comments? ___ 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