You can, and have to, earn this trophy before the point of no return. If you don't you will have to replay the game as far as I am aware. The point of no return is very obvious and the game tells you straight up.
And you cannot miss any upgrade materials since they will all show up in the lost and found in case you miss one in a level! The cost of upgrading all the weapons is quite hefty so I would do this trophy on your Score Attack playthrough where you can replay the missions to farm fragments instead of having to replay the dreams all the time.