From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 21 May 2012 10:47:12 -0500 Subject: [U-Boot] [PATCH v3 6/7] tegra: nand: Add Tegra NAND driver In-Reply-To: <4B9C9637D5087840A465BDCB251780E9E2D5582388@HKMAIL02.nvidia.com> References: <1334688614-4977-1-git-send-email-sjg@chromium.org> <1334688614-4977-7-git-send-email-sjg@chromium.org> <4F9877DC.8050605@freescale.com> <4B9C9637D5087840A465BDCB251780E9E2D5582388@HKMAIL02.nvidia.com> Message-ID: <4FBA6380.3060603@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/21/2012 05:07 AM, Jim Lin wrote: >> diff --git a/drivers/mtd/nand/tegra2_nand.h b/drivers/mtd/nand/tegra2_nand.h >> new file mode 100644 >> index 0000000..7e74be7 >> --- /dev/null >> +++ b/drivers/mtd/nand/tegra2_nand.h >> @@ -0,0 +1,257 @@ >> +/* >> + * (C) Copyright 2011 NVIDIA Corporation >> + * >> + * See file CREDITS for list of people who contributed to this >> + * project. >> + * >> + * This program is free software; you can redistribute it and/or >> + * modify it under the terms of the GNU General Public License as >> + * published by the Free Software Foundation; either version 2 of >> + * the License, or (at your option) any later version. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + * >> + * You should have received a copy of the GNU General Public License >> + * along with this program; if not, write to the Free Software >> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, >> + * MA 02111-1307 USA >> + */ >> + >> +/* register offset */ >> +#define COMMAND_0 0x00 >> +#define CMD_GO (1 << 31) >> +#define CMD_CLE (1 << 30) >> +#define CMD_ALE (1 << 29) >> +#define CMD_PIO (1 << 28) >> +#define CMD_TX (1 << 27) >> +#define CMD_RX (1 << 26) >> +#define CMD_SEC_CMD (1 << 25) >> +#define CMD_AFT_DAT_MASK (1 << 24) >> +#define CMD_AFT_DAT_DISABLE 0 >> +#define CMD_AFT_DAT_ENABLE (1 << 24) >> +#define CMD_TRANS_SIZE_SHIFT 20 >> +#define CMD_TRANS_SIZE_PAGE 8 > > Please use proper namespacing on symbols defined in headers. > > [Jim] Scott, I don't know what you meant. Could you give me an example? > Thanks. > The names like AFT_DAT_MASK, TRANS_SIZE_SHIFT, and TRANS_SIZE_PAGE come from field names of register in data sheet. Names in your data sheet are presumably unique within that chip, but not within U-Boot as a whole. Names like CMD_CLE, CMD_TX, etc. are particularly likely to conflict (at least, if at least one other driver were similarly loose with its naming). Prefix these with TEGRA_ or TEGRA_NAND_ -Scott