Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15 luci eht #13

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion target/linux/mediatek/image/filogic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ define Device/bananapi_bpi-r4-common
DEVICE_DTS_LOADADDR := 0x45f00000
DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd mt7988a-bananapi-bpi-r4-wifi-mt7996a
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-thermal kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \
kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs
IMAGES := sysupgrade.itb
KERNEL_LOADADDR := 0x46000000
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -414,13 +414,13 @@
const struct firmware *fw[FW_NB];
char fw_path[37], *dir = NULL;
int i, j, ret = 0, pe;
- int ipuesz, ifppsz, minifw = 0;
+ int ipuesz, ifppsz, minifw = 1;

if (priv->data->version == EIP197D_MRVL)
dir = "eip197d";
else if (priv->data->version == EIP197B_MRVL ||
priv->data->version == EIP197_DEVBRD)
- dir = "eip197b";
+ dir = "eip197_minifw";
else if (priv->data->version == EIP197C_MXL)
dir = "eip197c";
else
@@ -455,6 +455,9 @@

ipuesz = eip197_write_firmware(priv, fw[FW_IPUE]);

+ for (j = 0; j < i; j++)
+ release_firmware(fw[j]);
+
if (eip197_start_firmware(priv, ipuesz, ifppsz, minifw)) {
dev_dbg(priv->dev, "Firmware loaded successfully\n");
return 0;
@@ -605,6 +608,11 @@
*/
if (priv->flags & SAFEXCEL_HW_EIP197) {
val = readl(EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL);
+ /* Clear axi_burst_size and rx_burst_size */
+ val &= 0xffffff00;
+ /* Set axi_burst_size = 3, rx_burst_size = 3 */
+ val |= EIP197_MST_CTRL_RD_CACHE(3);
+ val |= EIP197_MST_CTRL_WD_CACHE(3);
val |= EIP197_MST_CTRL_TX_MAX_CMD(5);
writel(val, EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL);
}
@@ -805,6 +813,12 @@
return ret;
}

+ /* Allow clocks to be forced on for EIP197 */
+ if (priv->flags & SAFEXCEL_HW_EIP197) {
+ writel(0xffffffff, EIP197_HIA_GEN_CFG(priv) + EIP197_FORCE_CLOCK_ON);
+ writel(0xffffffff, EIP197_HIA_GEN_CFG(priv) + EIP197_FORCE_CLOCK_ON2);
+ }
+
return safexcel_hw_setup_cdesc_rings(priv) ?:
safexcel_hw_setup_rdesc_rings(priv) ?:
0;
@@ -1746,6 +1760,7 @@
{
struct device *dev = &pdev->dev;
struct safexcel_crypto_priv *priv;
+ struct resource *res;
int ret;

priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -1757,7 +1772,11 @@

platform_set_drvdata(pdev, priv);

- priv->base = devm_platform_ioremap_resource(pdev, 0);
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return -EINVAL;
+
+ priv->base = devm_ioremap(dev, res->start, resource_size(res));
if (IS_ERR(priv->base)) {
dev_err(dev, "failed to get resource\n");
return PTR_ERR(priv->base);
--- a/drivers/crypto/inside-secure/safexcel.h
+++ b/drivers/crypto/inside-secure/safexcel.h
@@ -189,6 +189,8 @@
#define EIP197_PE_DEBUG(n) (0x1ff4 + (0x2000 * (n)))
#define EIP197_PE_OPTIONS(n) (0x1ff8 + (0x2000 * (n)))
#define EIP197_PE_VERSION(n) (0x1ffc + (0x2000 * (n)))
+#define EIP197_FORCE_CLOCK_ON2 0xffd8
+#define EIP197_FORCE_CLOCK_ON 0xffe8
#define EIP197_MST_CTRL 0xfff4
#define EIP197_OPTIONS 0xfff8
#define EIP197_VERSION 0xfffc
Loading