From nobody Wed Aug 11 18:25:45 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BDC70137B329 for ; Wed, 11 Aug 2021 18:25:59 +0000 (UTC) (envelope-from kamalpr@gmail.com) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GlJD65LLvz3qft for ; Wed, 11 Aug 2021 18:25:58 +0000 (UTC) (envelope-from kamalpr@gmail.com) Received: by mail-wm1-x330.google.com with SMTP id w21-20020a7bc1150000b02902e69ba66ce6so2621187wmi.1 for ; Wed, 11 Aug 2021 11:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=pwAbrjuEOdIQa0yz/V7qJlxnums0nxYY4YUIQl4juKE=; b=lKkgCu0Ff8ZnEyD5JOXKRpBmv7Q09wSSMZw909tdy9RQRowim/KWCJbldIulO8FB3r VfbNOTB6ox7vsiqRDltaPritYevJJCzWh0H+m3tPGJLZb3fkTFkVURc+0T2e7J7o+934 Q8dS9ewp6ZFmTD1z/DbATErGoSD+qBBdGdJsC9FixpLqRrv6TLnpIkF2vAA/qi+hNb5E R3v0pckZIiJpJgVaUIqgUApF5R3c89PY1vsdCY0nHGHFVfGYV4qQqvcHygWdS9X5XGDy q0VKcwWgU1dQsFHTS+2iy4jA7g0b4rTZ829+7uXfUF3qmoiUSg/W5HOK9wm3eyv7UPzd IrlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=pwAbrjuEOdIQa0yz/V7qJlxnums0nxYY4YUIQl4juKE=; b=ZRw2+CCMCEVH6YmB+xpN/dGFUDb7KphMMCfTeTn040mRS6J5by435GM1pdkqiOqtS3 2V3wzf2YC0H9QeKkR4RudoaXKbtEhsMVy1qk5TycuTyGb6HN4VvEUQ9AvpqQt8aFMkcI ruMrZ6rLkj5iu1zOGmvFqVnnbuCpv7tr4+BwBUp0NBmsukIpDg5aUtMVH9r6cFib3Ubk pEst6PT/VNe3HoEmHR6Q8jsaCQIg2MuzJkNU63JoweniSXObY+MnWjBcfA+9XVcppcXE 0ot8skK32SllICS9cI9sprJjClTdRfancFNC49uEaxja0nOSCOCjDQk6Axjq1WjIntqw ZpzA== X-Gm-Message-State: AOAM530EyyB7fULqaM09zBsQlv7Jy6NAcikkBPPmRcEB6FffZTPoC9hh p8gbF/f0YCDbnPjhgIe5dKMekEXG0wYAtFrSEGgU5XZjyw== X-Google-Smtp-Source: ABdhPJwGiQB6vzrO/cdmd5+LOseysACg6yPNNUukQj4hGtceN3tZi94uLcXPz+Emj3ccp/gY8xKpzYDccm41dbAxuyM= X-Received: by 2002:a05:600c:28b:: with SMTP id 11mr11017625wmk.6.1628706357577; Wed, 11 Aug 2021 11:25:57 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Reply-To: kamalpr@gmail.com From: "Kamal R. Prasad" Date: Wed, 11 Aug 2021 23:55:45 +0530 Message-ID: Subject: reset sdhci device To: freebsd-arm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GlJD65LLvz3qft X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lKkgCu0F; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of kamalpr@gmail.com designates 2a00:1450:4864:20::330 as permitted sender) smtp.mailfrom=kamalpr@gmail.com X-Spamd-Result: default: False [-1.96 / 15.00]; HAS_REPLYTO(0.00)[kamalpr@gmail.com]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::330:from]; NEURAL_HAM_SHORT(-0.96)[-0.959]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N hello, i am trying to reset sdhci device but i see interrupts are not cleared. do i need to reset the bus too like they do in linux? here is my code. thanks -kamal static void sdhci_resethw(struct sdhci_slot* slot) { uint32_t clock = slot->clock; uint16_t hostctrl2 = RD2(slot, SDHCI_HOST_CONTROL2); u_char hostctrl = slot->hostctrl; u_char power = slot->power; sdhci_set_power(slot, 0); DELAY(10); sdhci_init(slot); sdhci_set_power(slot, power); DELAY(10); sdhci_set_clock(slot, clock); slot->hostctrl = hostctrl; WR1(slot, SDHCI_HOST_CONTROL, slot->hostctrl); WR2(slot, SDHCI_HOST_CONTROL2, hostctrl2); DELAY(10);