summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-04-15 07:31:14 -0400
committerTom Rini <trini@konsulko.com>2019-04-15 07:31:14 -0400
commit75ce8c938d39bd22460be66e6bf318bd2410c17b (patch)
treede11d41e826990d8e000b8b95a163f462f671054 /drivers
parent38f94d3539d070485e773c660a1d1a3429c52743 (diff)
parente0627f77f55ea8d606cd4b0902bc47ffaad220d0 (diff)
Merge tag 'u-boot-imx-20190415' of git://git.denx.de/u-boot-imx
Move to DM ----------- - DM support in sata - Toradex Board to DM - wandboard to DM - tbs2910 to DM - GE boards to DM - VHybrid boards to DM - DM_VIDEO for i.MX
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/Kconfig8
-rw-r--r--drivers/ata/dwc_ahsata.c38
-rw-r--r--drivers/misc/Kconfig2
-rw-r--r--drivers/net/Kconfig2
-rw-r--r--drivers/net/fec_mxc.c1
-rw-r--r--drivers/usb/host/Kconfig7
-rw-r--r--drivers/video/Kconfig9
-rw-r--r--drivers/video/Makefile2
-rw-r--r--drivers/video/imx/Kconfig8
-rw-r--r--drivers/video/imx/Makefile6
-rw-r--r--drivers/video/imx/ipu.h (renamed from drivers/video/ipu.h)0
-rw-r--r--drivers/video/imx/ipu_common.c (renamed from drivers/video/ipu_common.c)0
-rw-r--r--drivers/video/imx/ipu_disp.c (renamed from drivers/video/ipu_disp.c)0
-rw-r--r--drivers/video/imx/ipu_regs.h (renamed from drivers/video/ipu_regs.h)0
-rw-r--r--drivers/video/imx/mxc_ipuv3_fb.c (renamed from drivers/video/mxc_ipuv3_fb.c)89
-rw-r--r--drivers/video/imx/mxcfb.h (renamed from drivers/video/mxcfb.h)0
-rw-r--r--drivers/video/videomodes.c2
17 files changed, 152 insertions, 22 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 7ebee75c0a..593e9cbc1f 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -66,6 +66,14 @@ config DWC_AHSATA
Enable this driver to support the DWC AHSATA SATA controller found
in i.MX5 and i.MX6 SoCs.
+config DWC_AHSATA_AHCI
+ bool "Enable DWC AHSATA AHCI driver support"
+ depends on DWC_AHSATA
+ depends on AHCI
+ default y
+ help
+ Enable this option unless you need your private ahci implementation
+
config FSL_SATA
bool "Enable Freescale SATA controller driver support"
select LIBATA
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
index 4c5b98482f..afced8e7e3 100644
--- a/drivers/ata/dwc_ahsata.c
+++ b/drivers/ata/dwc_ahsata.c
@@ -16,6 +16,7 @@
#include <asm/io.h>
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
+#include <asm/mach-imx/sata.h>
#include <linux/bitops.h>
#include <linux/ctype.h>
#include <linux/errno.h>
@@ -511,15 +512,9 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
static void dwc_ahsata_print_info(struct blk_desc *pdev)
{
printf("SATA Device Info:\n\r");
-#ifdef CONFIG_SYS_64BIT_LBA
printf("S/N: %s\n\rProduct model number: %s\n\r"
- "Firmware version: %s\n\rCapacity: %lld sectors\n\r",
+ "Firmware version: %s\n\rCapacity: " LBAFU " sectors\n\r",
pdev->product, pdev->vendor, pdev->revision, pdev->lba);
-#else
- printf("S/N: %s\n\rProduct model number: %s\n\r"
- "Firmware version: %s\n\rCapacity: %ld sectors\n\r",
- pdev->product, pdev->vendor, pdev->revision, pdev->lba);
-#endif
}
static void dwc_ahsata_identify(struct ahci_uc_priv *uc_priv, u16 *id)
@@ -754,7 +749,6 @@ static int dwc_ahsata_scan_common(struct ahci_uc_priv *uc_priv,
u8 serial[ATA_ID_SERNO_LEN + 1] = { 0 };
u8 firmware[ATA_ID_FW_REV_LEN + 1] = { 0 };
u8 product[ATA_ID_PROD_LEN + 1] = { 0 };
- u64 n_sectors;
u8 port = uc_priv->hard_port_no;
ALLOC_CACHE_ALIGN_BUFFER(u16, id, ATA_ID_WORDS);
@@ -773,9 +767,8 @@ static int dwc_ahsata_scan_common(struct ahci_uc_priv *uc_priv,
ata_id_c_string(id, product, ATA_ID_PROD, sizeof(product));
memcpy(pdev->vendor, product, sizeof(product));
- /* Totoal sectors */
- n_sectors = ata_id_n_sectors(id);
- pdev->lba = (u32)n_sectors;
+ /* Total sectors */
+ pdev->lba = ata_id_n_sectors(id);
pdev->type = DEV_TYPE_HARDDISK;
pdev->blksz = ATA_SECT_SIZE;
@@ -1028,6 +1021,9 @@ int dwc_ahsata_probe(struct udevice *dev)
struct ahci_uc_priv *uc_priv = dev_get_uclass_priv(dev);
int ret;
+#if defined(CONFIG_MX6)
+ setup_sata();
+#endif
uc_priv->host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | ATA_FLAG_NO_ATAPI;
uc_priv->mmio_base = (void __iomem *)dev_read_addr(dev);
@@ -1075,4 +1071,24 @@ U_BOOT_DRIVER(dwc_ahsata_blk) = {
.ops = &dwc_ahsata_blk_ops,
};
+#if CONFIG_IS_ENABLED(DWC_AHSATA_AHCI)
+struct ahci_ops dwc_ahsata_ahci_ops = {
+ .port_status = dwc_ahsata_port_status,
+ .reset = dwc_ahsata_bus_reset,
+ .scan = dwc_ahsata_scan,
+};
+
+static const struct udevice_id dwc_ahsata_ahci_ids[] = {
+ { .compatible = "fsl,imx6q-ahci" },
+ { }
+};
+
+U_BOOT_DRIVER(dwc_ahsata_ahci) = {
+ .name = "dwc_ahsata_ahci",
+ .id = UCLASS_AHCI,
+ .of_match = dwc_ahsata_ahci_ids,
+ .ops = &dwc_ahsata_ahci_ops,
+ .probe = dwc_ahsata_probe,
+};
+#endif
#endif
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index d6e677fba8..0e645f58be 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -128,6 +128,8 @@ config JZ4780_EFUSE
config MXC_OCOTP
bool "Enable MXC OCOTP Driver"
+ depends on ARCH_IMX8M || ARCH_MX6 || ARCH_MX7 || ARCH_VF610
+ default y
help
If you say Y here, you will get support for the One Time
Programmable memory pages that are stored on the some
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 77d0b3a01f..d0e5426a99 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -190,7 +190,7 @@ config FEC_MXC_MDIO_BASE
config FEC_MXC
bool "FEC Ethernet controller"
- depends on MX5 || MX6 || MX7 || IMX8
+ depends on MX5 || MX6 || MX7 || IMX8 || VF610
help
This driver supports the 10/100 Fast Ethernet controller for
NXP i.MX processors.
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 84f010d805..a672250e16 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1491,6 +1491,7 @@ static const struct udevice_id fecmxc_ids[] = {
{ .compatible = "fsl,imx6ul-fec" },
{ .compatible = "fsl,imx53-fec" },
{ .compatible = "fsl,imx7d-fec" },
+ { .compatible = "fsl,mvf600-fec" },
{ }
};
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index ba1e6bfa43..0fbc115801 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -154,6 +154,13 @@ config USB_EHCI_OMAP
Enables support for the on-chip EHCI controller on OMAP3 and later
SoCs.
+config USB_EHCI_VF
+ bool "Support for Vybrid on-chip EHCI USB controller"
+ depends on ARCH_VF610
+ default y
+ help
+ Enables support for the on-chip EHCI controller on Vybrid SoCs.
+
if USB_EHCI_MX7
config MXC_USB_OTG_HACTIVE
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 43412873c9..c3781b160d 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -538,6 +538,8 @@ config VIDEO_TEGRA124
source "drivers/video/bridge/Kconfig"
+source "drivers/video/imx/Kconfig"
+
config VIDEO
bool "Enable legacy video support"
depends on !DM_VIDEO
@@ -547,13 +549,6 @@ config VIDEO
model. Video drivers typically provide a colour text console and
cursor.
-config VIDEO_IPUV3
- bool "i.MX IPUv3 Core video support"
- depends on VIDEO && MX6
- help
- This enables framebuffer driver for i.MX processors working
- on the IPUv3(Image Processing Unit) internal graphic processor.
-
config CFB_CONSOLE
bool "Enable colour frame buffer console"
depends on VIDEO
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 671f037c35..349a207035 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -46,7 +46,7 @@ obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
obj-$(CONFIG_VIDEO_DW_HDMI) += dw_hdmi.o
obj-$(CONFIG_VIDEO_EFI) += efi.o
obj-$(CONFIG_VIDEO_FSL_DCU_FB) += fsl_dcu_fb.o videomodes.o
-obj-$(CONFIG_VIDEO_IPUV3) += mxc_ipuv3_fb.o ipu_common.o ipu_disp.o
+obj-$(CONFIG_VIDEO_IPUV3) += imx/
obj-$(CONFIG_VIDEO_IVYBRIDGE_IGD) += ivybridge_igd.o
obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o
obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
diff --git a/drivers/video/imx/Kconfig b/drivers/video/imx/Kconfig
new file mode 100644
index 0000000000..c33620e075
--- /dev/null
+++ b/drivers/video/imx/Kconfig
@@ -0,0 +1,8 @@
+
+config VIDEO_IPUV3
+ bool "i.MX IPUv3 Core video support"
+ depends on (VIDEO || DM_VIDEO) && (MX5 || MX6)
+ help
+ This enables framebuffer driver for i.MX processors working
+ on the IPUv3(Image Processing Unit) internal graphic processor.
+
diff --git a/drivers/video/imx/Makefile b/drivers/video/imx/Makefile
new file mode 100644
index 0000000000..179ea651fe
--- /dev/null
+++ b/drivers/video/imx/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2000-2007
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+
+obj-y += mxc_ipuv3_fb.o ipu_common.o ipu_disp.o
diff --git a/drivers/video/ipu.h b/drivers/video/imx/ipu.h
index 1e02c7ab6d..1e02c7ab6d 100644
--- a/drivers/video/ipu.h
+++ b/drivers/video/imx/ipu.h
diff --git a/drivers/video/ipu_common.c b/drivers/video/imx/ipu_common.c
index cbe1984e4f..cbe1984e4f 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/imx/ipu_common.c
diff --git a/drivers/video/ipu_disp.c b/drivers/video/imx/ipu_disp.c
index 5c7722962d..5c7722962d 100644
--- a/drivers/video/ipu_disp.c
+++ b/drivers/video/imx/ipu_disp.c
diff --git a/drivers/video/ipu_regs.h b/drivers/video/imx/ipu_regs.h
index deb44002d7..deb44002d7 100644
--- a/drivers/video/ipu_regs.h
+++ b/drivers/video/imx/ipu_regs.h
diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index 23cd55de47..3e38d4bdcc 100644
--- a/drivers/video/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -17,13 +17,17 @@
#include <linux/list.h>
#include <linux/fb.h>
#include <asm/io.h>
+#include <asm/mach-imx/video.h>
#include <malloc.h>
#include <video_fb.h>
-#include "videomodes.h"
+#include "../videomodes.h"
#include "ipu.h"
#include "mxcfb.h"
#include "ipu_regs.h"
+#include <dm.h>
+#include <video.h>
+
DECLARE_GLOBAL_DATA_PTR;
static int mxcfb_map_video_memory(struct fb_info *fbi);
@@ -401,8 +405,14 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
fbi->fix.line_length;
}
fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN);
+
+#if CONFIG_IS_ENABLED(DM_VIDEO)
+ fbi->screen_base = (char *)gd->video_bottom;
+#else
fbi->screen_base = (char *)memalign(ARCH_DMA_MINALIGN,
fbi->fix.smem_len);
+#endif
+
fbi->fix.smem_start = (unsigned long)fbi->screen_base;
if (fbi->screen_base == 0) {
puts("Unable to allocate framebuffer memory\n");
@@ -416,7 +426,9 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
fbi->screen_size = fbi->fix.smem_len;
+#if CONFIG_IS_ENABLED(VIDEO)
gd->fb_base = fbi->fix.smem_start;
+#endif
/* Clear the screen */
memset((char *)fbi->screen_base, 0, fbi->fix.smem_len);
@@ -611,3 +623,78 @@ int ipuv3_fb_init(struct fb_videomode const *mode,
return 0;
}
+
+#if CONFIG_IS_ENABLED(DM_VIDEO)
+enum {
+ /* Maximum display size we support */
+ LCD_MAX_WIDTH = 1920,
+ LCD_MAX_HEIGHT = 1080,
+ LCD_MAX_LOG2_BPP = VIDEO_BPP16,
+};
+
+static int ipuv3_video_probe(struct udevice *dev)
+{
+ struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+ u32 fb_start, fb_end;
+ int ret;
+
+ debug("%s() plat: base 0x%lx, size 0x%x\n",
+ __func__, plat->base, plat->size);
+
+ ret = ipu_probe();
+ if (ret)
+ return ret;
+
+ ret = ipu_displays_init();
+ if (ret < 0)
+ return ret;
+
+ ret = mxcfb_probe(gpixfmt, gdisp, gmode);
+ if (ret < 0)
+ return ret;
+
+ uc_priv->xsize = gmode->xres;
+ uc_priv->ysize = gmode->yres;
+ uc_priv->bpix = LCD_MAX_LOG2_BPP;
+
+ /* Enable dcache for the frame buffer */
+ fb_start = plat->base & ~(MMU_SECTION_SIZE - 1);
+ fb_end = plat->base + plat->size;
+ fb_end = ALIGN(fb_end, 1 << MMU_SECTION_SHIFT);
+ mmu_set_region_dcache_behaviour(fb_start, fb_end - fb_start,
+ DCACHE_WRITEBACK);
+ video_set_flush_dcache(dev, true);
+
+ return 0;
+}
+
+struct ipuv3_video_priv {
+ ulong regs;
+};
+
+static int ipuv3_video_bind(struct udevice *dev)
+{
+ struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+
+ plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
+ (1 << LCD_MAX_LOG2_BPP) / 8;
+
+ return 0;
+}
+
+static const struct udevice_id ipuv3_video_ids[] = {
+ { .compatible = "fsl,imx6q-ipu" },
+ { }
+};
+
+U_BOOT_DRIVER(ipuv3_video) = {
+ .name = "ipuv3_video",
+ .id = UCLASS_VIDEO,
+ .of_match = ipuv3_video_ids,
+ .bind = ipuv3_video_bind,
+ .probe = ipuv3_video_probe,
+ .priv_auto_alloc_size = sizeof(struct ipuv3_video_priv),
+ .flags = DM_FLAG_PRE_RELOC,
+};
+#endif /* CONFIG_DM_VIDEO */
diff --git a/drivers/video/mxcfb.h b/drivers/video/imx/mxcfb.h
index 0dc3886193..0dc3886193 100644
--- a/drivers/video/mxcfb.h
+++ b/drivers/video/imx/mxcfb.h
diff --git a/drivers/video/videomodes.c b/drivers/video/videomodes.c
index 1cfeaa980f..d7614329ff 100644
--- a/drivers/video/videomodes.c
+++ b/drivers/video/videomodes.c
@@ -397,7 +397,7 @@ int video_edid_dtd_to_ctfb_res_modes(struct edid_detailed_timing *t,
EDID_DETAILED_TIMING_VERTICAL_BLANKING(*t) == 0 ||
EDID_DETAILED_TIMING_HSYNC_OFFSET(*t) == 0 ||
EDID_DETAILED_TIMING_VSYNC_OFFSET(*t) == 0 ||
- /* 3d formats are not supported*/
+ /* 3d formats are not supported */
EDID_DETAILED_TIMING_FLAG_STEREO(*t) != 0)
return -EINVAL;