Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97FF4C636D4 for ; Wed, 1 Feb 2023 20:27:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CF59585DA3; Wed, 1 Feb 2023 21:23:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="joR2xzeL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5AFC385D21; Wed, 1 Feb 2023 21:22:41 +0100 (CET) Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B432185CFB for ; Wed, 1 Feb 2023 21:22:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2e.google.com with SMTP id k13so4766923iob.9 for ; Wed, 01 Feb 2023 12:22:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aI79qP+7n9J4uE5IE7KNc1IKlIlQfFMMbRZIynt8Gws=; b=joR2xzeLKyDcDBgaZXGyLcbqkcLnuo8jlgmHNVvu9hcxJBSsTlfn6kTBYx2eiW58Ln QIW9Ryzk6bZrxcwMDyFCI3axDo4dKrRLAFIK8gjwqxlipXMwn2JDIUpmihKBCjhhssS8 yVm2Bl8FUmJ5/kGCqOBIDJdicHmt2i0wymQWI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aI79qP+7n9J4uE5IE7KNc1IKlIlQfFMMbRZIynt8Gws=; b=M18VGNBMgtBdjJdEEJIT0mXA3H1gilWvN2v2h7VpoMZbv8yMziv4QDUREaacMPW94H GefaakpCzcEGR7uOS3KpmGVhAhpdmFn5cQnDtpV/Uj/CmxH5myEepRTQykh4qDlL0Dah aFiBqI+ltS4/odHkigsoeGcmzIkQOTFkC03aWnxrzTXCoAxSdO7r8hoZIlVTdW+gvrGP PGFK9+63s+T5rGNvn6CS4BVWUv/zluJmVN/Ispn+Gg3WfTm40Ef5bpegNIBvrh8AWyxw Dxnl0fTxrCUHv2Dh5VuKkmx4F3K9dxsN/1u4SIfPri7E95vNCsNvlPkeu7vhRU024/pD gNRg== X-Gm-Message-State: AO0yUKWNAn7pod+Vuoq8D1P6QR2gDVRx9obGhOMDF9O8nKOtpQX9E2m/ LjXmiy1E519F1koHeOKWPQvI0gNLDEPQ9LOJ X-Google-Smtp-Source: AK7set+BsgLupxOEP7WN0KGr4AMGS+67prau0oSu9UnQBkyFXCXqe8BjTLPMpM9nI9TiYRBFxJ+m0g== X-Received: by 2002:a5e:8e04:0:b0:71f:2e0b:5c64 with SMTP id a4-20020a5e8e04000000b0071f2e0b5c64mr2559337ion.3.1675282949133; Wed, 01 Feb 2023 12:22:29 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:1fda:cca0:9a42:148c]) by smtp.gmail.com with ESMTPSA id i1-20020a6bf401000000b00704608527d1sm6166498iog.37.2023.02.01.12.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 12:22:28 -0800 (PST) From: Simon Glass To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass Subject: [PATCH v3 75/76] freescale: Drop unused zm7300 driver Date: Wed, 1 Feb 2023 13:20:26 -0700 Message-Id: <20230201202027.1943031-76-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230201202027.1943031-1-sjg@chromium.org> References: <20230201202027.1943031-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This is not used anymore. Drop the driver and Kconfig option. Signed-off-by: Simon Glass --- (no changes since v1) board/freescale/common/Makefile | 1 - board/freescale/common/zm7300.c | 232 -------------------------------- board/freescale/common/zm7300.h | 21 --- 3 files changed, 254 deletions(-) delete mode 100644 board/freescale/common/zm7300.c delete mode 100644 board/freescale/common/zm7300.h diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index c200cf4d403..b4faf6f9e0a 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -54,7 +54,6 @@ obj-$(CONFIG_TARGET_MPC8548CDS) += cds_pci_ft.o obj-$(CONFIG_TARGET_P3041DS) += ics307_clk.o obj-$(CONFIG_TARGET_P4080DS) += ics307_clk.o obj-$(CONFIG_TARGET_P5040DS) += ics307_clk.o -obj-$(CONFIG_ZM7300) += zm7300.o ifeq ($(CONFIG_$(SPL_)POWER_LEGACY),y) obj-$(CONFIG_POWER_PFUZE100) += pfuze.o endif diff --git a/board/freescale/common/zm7300.c b/board/freescale/common/zm7300.c deleted file mode 100644 index e8c2fc85c84..00000000000 --- a/board/freescale/common/zm7300.c +++ /dev/null @@ -1,232 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright 2013 Freescale Semiconductor, Inc. - */ - -/* Power-One ZM7300 DPM */ -#include "zm7300.h" -#include - -#define DPM_WP 0x96 -#define WRP_OPCODE 0x01 -#define WRM_OPCODE 0x02 -#define RRP_OPCODE 0x11 - -#define DPM_SUCCESS 0x01 -#define DPM_EXEC_FAIL 0x00 - -static const uint16_t hex_to_1_10mv[] = { - 5000, - 5125, - 5250, - 5375, - 5500, - 5625, - 5750, - 5875, - 6000, - 6125, - 6250, - 6375, - 6500, - 6625, - 6750, - 6875, - 7000, - 7125, - 7250, - 7375, - 7500, - 7625, - 7750, - 7875, - 8000, - 8125, - 8250, - 8375, - 8500, - 8625, - 8750, - 8875, - 9000, - 9125, - 9250, - 9375, - 9500, /* 0.95mV */ - 9625, - 9750, - 9875, - 10000, /* 1.0V */ - 10125, - 10250, - 10375, - 10500, - 10625, - 10750, - 10875, - 11000, - 11125, - 11250, - 11375, - 11500, - 11625, - 11750, - 11875, - 12000, - 12125, - 12250, - 12375, - 0, /* reserved */ -}; - - -/* Read Data d from Register r of POL p */ -u8 dpm_rrp(uchar r) -{ - u8 ret[5]; - - ret[0] = RRP_OPCODE; - /* POL is 0 */ - ret[1] = 0; - ret[2] = r; - i2c_read(I2C_DPM_ADDR, 0, -3, ret, 2); - if (ret[1] == DPM_SUCCESS) { /* the DPM returned success as status */ - debug("RRP_OPCODE returned success data is %x\n", ret[0]); - return ret[0]; - } else { - return -1; - } -} - -/* Write Data d into DPM register r (RAM) */ -int dpm_wrm(u8 r, u8 d) -{ - u8 ret[5]; - - ret[0] = WRM_OPCODE; - ret[1] = r; - ret[2] = d; - i2c_read(I2C_DPM_ADDR, 0, -3, ret, 1); - if (ret[0] == DPM_SUCCESS) { /* the DPM returned success as status */ - debug("WRM_OPCODE returned success data is %x\n", ret[0]); - return ret[0]; - } else { - return -1; - } -} - -/* Write Data d into Register r of POL(s) a */ -int dpm_wrp(u8 r, u8 d) -{ - u8 ret[7]; - - ret[0] = WRP_OPCODE; - /* only POL0 is present */ - ret[1] = 0x01; - ret[2] = 0x00; - ret[3] = 0x00; - ret[4] = 0x00; - ret[5] = r; - ret[6] = d; - i2c_read(I2C_DPM_ADDR, 0, -7, ret, 1); - if (ret[0] == DPM_SUCCESS) { /* the DPM returned success as status */ - debug("WRP_OPCODE returned success data is %x\n", ret[0]); - return 0; - } else { - return -1; - } -} - -/* Uses the DPM command RRP */ -u8 zm_read(uchar reg) -{ - return dpm_rrp(reg); -} - -/* ZM_write -- - Steps: - a. Write data to the register - b. Read data from register and compare to written value - c. Return return_code & voltage_read -*/ -u8 zm_write(u8 reg, u8 data) -{ - u8 d; - - /* write data to register */ - dpm_wrp(reg, data); - - /* read register and compare to written value */ - d = dpm_rrp(reg); - if (d != data) { - printf("zm_write : Comparison register data failed\n"); - return -1; - } - - return d; -} - -/* zm_write_out_voltage - * voltage in 1/10 mV - */ -int zm_write_voltage(int voltage) -{ - u8 reg = 0x7, vid; - uint16_t voltage_read; - u8 ret; - - vid = (voltage - 5000) / ZM_STEP; - - ret = zm_write(reg, vid); - if (ret != -1) { - voltage_read = hex_to_1_10mv[ret]; - debug("voltage set to %dmV\n", voltage_read/10); - return voltage_read; - } - return -1; -} - -/* zm_read_out_voltage - * voltage in 1/10 mV - */ -int zm_read_voltage(void) -{ - u8 reg = 0x7; - u8 ret; - int voltage; - - ret = zm_read(reg); - if (ret != -1) { - voltage = hex_to_1_10mv[ret]; - debug("Voltage read is %dmV\n", voltage/10); - return voltage; - } else { - return -1; - } -} - -int zm_disable_wp() -{ - u8 new_wp_value; - - /* Disable using Write-Protect register 0x96 */ - new_wp_value = 0x8; - if ((dpm_wrm(DPM_WP, new_wp_value)) < 0) { - printf("Disable Write-Protect register failed\n"); - return -1; - } - return 0; -} - -int zm_enable_wp() -{ - u8 orig_wp_value; - orig_wp_value = 0x0; - - /* Enable using Write-Protect register 0x96 */ - if ((dpm_wrm(DPM_WP, orig_wp_value)) < 0) { - printf("Enable Write-Protect register failed\n"); - return -1; - } - return 0; -} diff --git a/board/freescale/common/zm7300.h b/board/freescale/common/zm7300.h deleted file mode 100644 index 9ce24afc178..00000000000 --- a/board/freescale/common/zm7300.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright 2013 Freescale Semiconductor, Inc. - */ - -#ifndef __ZM7300_H_ -#define __ZM7300_H 1_ - -#include -#include -#include -#include - -#define ZM_STEP 125 -int zm7300_set_voltage(int voltage_1_10mv); -int zm_write_voltage(int voltage); -int zm_read_voltage(void); -int zm_disable_wp(void); -int zm_enable_wp(void); - -#endif /* __ZM7300_H_ */ -- 2.39.1.456.gfc5497dd1b-goog