Commit 8370978318337df3979aa0852529d53d77ed736e
Committed by
Scott Wood
1 parent
91081e01b1
Exists in
master
and in
54 other branches
Decreases code size of the nand_spl
The canyonland boards nand_spl size is just under the maximum 4KByte size. This patch decreases the size of the nand_spl to make a previous commit - commit 65a9db7be0868be91ba81b9b5bf821de82e6d9b0 - fit in the nand_spl. Signed-off-by: Alex Waterman <awaterman@dawning.com> Acked-by: Stefan Roese <sr@denx.de> Signed-off-by: Scott Wood <scottwood@freescale.com>
Showing 1 changed file with 10 additions and 8 deletions Side-by-side Diff
nand_spl/nand_boot.c
... | ... | @@ -77,6 +77,8 @@ |
77 | 77 | { |
78 | 78 | struct nand_chip *this = mtd->priv; |
79 | 79 | int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT; |
80 | + void (*hwctrl)(struct mtd_info *mtd, int cmd, | |
81 | + unsigned int ctrl) = this->cmd_ctrl; | |
80 | 82 | |
81 | 83 | if (this->dev_ready) |
82 | 84 | while (!this->dev_ready(mtd)) |
83 | 85 | |
84 | 86 | |
85 | 87 | |
86 | 88 | |
87 | 89 | |
88 | 90 | |
... | ... | @@ -95,25 +97,25 @@ |
95 | 97 | offs >>= 1; |
96 | 98 | |
97 | 99 | /* Begin command latch cycle */ |
98 | - this->cmd_ctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE); | |
100 | + hwctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE); | |
99 | 101 | /* Set ALE and clear CLE to start address cycle */ |
100 | 102 | /* Column address */ |
101 | - this->cmd_ctrl(mtd, offs & 0xff, | |
103 | + hwctrl(mtd, offs & 0xff, | |
102 | 104 | NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */ |
103 | - this->cmd_ctrl(mtd, (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */ | |
105 | + hwctrl(mtd, (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */ | |
104 | 106 | /* Row address */ |
105 | - this->cmd_ctrl(mtd, (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */ | |
106 | - this->cmd_ctrl(mtd, ((page_addr >> 8) & 0xff), | |
107 | + hwctrl(mtd, (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */ | |
108 | + hwctrl(mtd, ((page_addr >> 8) & 0xff), | |
107 | 109 | NAND_CTRL_ALE); /* A[27:20] */ |
108 | 110 | #ifdef CONFIG_SYS_NAND_5_ADDR_CYCLE |
109 | 111 | /* One more address cycle for devices > 128MiB */ |
110 | - this->cmd_ctrl(mtd, (page_addr >> 16) & 0x0f, | |
112 | + hwctrl(mtd, (page_addr >> 16) & 0x0f, | |
111 | 113 | NAND_CTRL_ALE); /* A[31:28] */ |
112 | 114 | #endif |
113 | 115 | /* Latch in address */ |
114 | - this->cmd_ctrl(mtd, NAND_CMD_READSTART, | |
116 | + hwctrl(mtd, NAND_CMD_READSTART, | |
115 | 117 | NAND_CTRL_CLE | NAND_CTRL_CHANGE); |
116 | - this->cmd_ctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); | |
118 | + hwctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); | |
117 | 119 | |
118 | 120 | /* |
119 | 121 | * Wait a while for the data to be ready |