Update for v1.0.15

This commit is contained in:
James Deng 2024-09-07 21:08:45 +08:00
parent 939bccfdae
commit 29c150fab9
4 changed files with 39 additions and 39 deletions

View file

@ -65,7 +65,8 @@ phy_link_time=10000
netdev=eth0
// Common boot args
commonargs=setenv bootargs earlycon=${earlycon} earlyprintk quiet splash plymouth.ignore-serial-consoles plymouth.prefer-fbcon console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init} workqueue.default_affinity_scope=${workqueue.default_affinity_scope}
set_bootargs=setenv bootargs earlycon=${earlycon} earlyprintk quiet splash console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init} product_name=${product_name}
commonargs=run set_bootargs; setenv bootargs "${bootargs}" plymouth.ignore-serial-consoles plymouth.prefer-fbcon workqueue.default_affinity_scope=${workqueue.default_affinity_scope}
//detect product_name from env and select dtb file to load
dtb_env=if test -n "${product_name}"; then \

View file

@ -116,7 +116,7 @@ static u32 mode_register_read(u32 MR, u32 CH, u32 CS)
read_data = readl((void __iomem*)DDR_MR_DATA);
}
UI3 = readl((void __iomem*)(DDR_BASE + 0x234)) & 0xFF;
UI3 = readl((void __iomem*)(DDR_BASE + 0x370)) & 0xFF;
return UI3;
}

View file

@ -14,6 +14,7 @@
#include <asm/global_data.h>
#include <dm/device-internal.h>
#include "sf_internal.h"
#include <blk.h>
DECLARE_GLOBAL_DATA_PTR;
@ -104,9 +105,44 @@ static int spi_flash_post_bind(struct udevice *dev)
return 0;
}
#ifdef CONFIG_SPINOR_BLOCK_SUPPORT
int spacemit_spinor_post_probe(struct udevice *dev)
{
struct blk_desc *bdesc;
struct udevice *bdev;
int ret;
struct udevice *parent_dev = dev->parent;
// Create the block device interface for the SPI NOR device with the same parent as dev
ret = blk_create_devicef(parent_dev, "nor_blk", "blk", IF_TYPE_NOR,
dev_seq(dev), SPI_NOR_BLOCK_SIZE, 0, &bdev);
if (ret) {
pr_err("Cannot create block device\n");
return ret;
}
// Obtain the block device descriptor
bdesc = dev_get_uclass_plat(bdev);
if (!bdesc) {
pr_err("Failed to get block device descriptor\n");
return -ENODEV;
}
// Initialize block device descriptor
bdesc->if_type = IF_TYPE_NOR;
bdesc->removable = 0;
dev_set_priv(bdev, dev);
return 0;
}
#endif /* CONFIG_SPINOR_BLOCK_SUPPORT */
UCLASS_DRIVER(spi_flash) = {
.id = UCLASS_SPI_FLASH,
.name = "spi_flash",
.post_bind = spi_flash_post_bind,
#ifdef CONFIG_SPINOR_BLOCK_SUPPORT
.post_probe = spacemit_spinor_post_probe,
#endif /* CONFIG_SPINOR_BLOCK_SUPPORT */
.per_device_auto = sizeof(struct spi_nor),
};

View file

@ -14,8 +14,6 @@
#include <malloc.h>
#include <spi.h>
#include <spi_flash.h>
#include <blk.h>
#include <dm/device-internal.h>
#include "sf_internal.h"
@ -165,38 +163,6 @@ static int spi_flash_std_remove(struct udevice *dev)
return 0;
}
#ifdef CONFIG_SPINOR_BLOCK_SUPPORT
int spacemit_spinor_bind(struct udevice *dev)
{
struct blk_desc *bdesc;
struct udevice *bdev;
int ret;
struct udevice *parent_dev = dev->parent;
// Create the block device interface for the SPI NOR device with the same parent as dev
ret = blk_create_devicef(parent_dev, "nor_blk", "blk", IF_TYPE_NOR,
dev_seq(dev), SPI_NOR_BLOCK_SIZE, 0, &bdev);
if (ret) {
pr_err("Cannot create block device\n");
return ret;
}
// Obtain the block device descriptor
bdesc = dev_get_uclass_plat(bdev);
if (!bdesc) {
pr_err("Failed to get block device descriptor\n");
return -ENODEV;
}
// Initialize block device descriptor
bdesc->if_type = IF_TYPE_NOR;
bdesc->removable = 0;
dev_set_priv(bdev, dev);
return 0;
}
#endif /* CONFIG_SPINOR_BLOCK_SUPPORT */
static const struct dm_spi_flash_ops spi_flash_std_ops = {
.read = spi_flash_std_read,
.write = spi_flash_std_write,
@ -217,9 +183,6 @@ U_BOOT_DRIVER(jedec_spi_nor) = {
.remove = spi_flash_std_remove,
.priv_auto = sizeof(struct spi_nor),
.ops = &spi_flash_std_ops,
#ifdef CONFIG_SPINOR_BLOCK_SUPPORT
.bind = spacemit_spinor_bind,
#endif /* CONFIG_SPINOR_BLOCK_SUPPORT */
.flags = DM_FLAG_OS_PREPARE,
};